jquery当中如何给某个属性赋值

例 1.7(attrSet.html)


<html>
<head>
<title>attr(name,value)方法</title>
<style type="text/css">
<!--
button{undefined
    border:1px solid #860066;
}
-->
</style>
<script language="javascript" src="jquery.min.js"></script>
<script language="javascript">
function DisableBack(){undefined
    //选择第2个和第3个button
/*<input type="text" name='aa[]' disabled="disabled" value='11'>*/  
    $("button:gt(0)").attr("disabled","disabled");
}
</script>
</head>
<body>
    <button οnclick="DisableBack()">第一个</button>
    <button>第二个</button>
    <button>第三个</button>
</body>
</html>

更多内容请见原文,文章转载自:https://blog.csdn.net/qq_44594371/article/details/103062221

posted @ 2021-12-31 12:35  malala  阅读(275)  评论(0编辑  收藏  举报