例 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