1. 程式人生 > 其它 >jquery當中如何給某個屬性賦值

jquery當中如何給某個屬性賦值

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