日期:2014-05-16 浏览次数:20484 次
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.8.0.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#chkAll").click(function () {
$("#chkList input[type='checkbox']").prop("checked", $(this).prop("checked"));
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:CheckBox ID="chkAll" Text="All" runat="server" />
<asp:CheckBoxList ID="chkList" runat="server">
<asp:ListItem Text="text1" />
<asp:ListItem Text="text2" />
</asp:CheckBoxList>
</div>
</form>
</body>
</html>