Html代码:
<html>
<head>
<title>我的第一个 HTML 页面</title>
</head>
<body>
<form action="" id="test">
<asp:CheckBox ID="cb1" Enabled="true" runat="server"/>
<asp:CheckBox ID="cb2" Enabled="true" runat="server" />
<asp:CheckBox ID="cb3" Enabled="true" runat="server" />
<asp:CheckBox ID="cb4" Enabled="true" runat="server" />
</form>
</body>
</html>
只选中一个js代码:
$('#test').find('input[type=checkbox]').bind('click', function() {
$('#test').find('input[type=checkbox]').not(this).attr("checked", false);
});