<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="../scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function security() {
var CheckCount = 0;
$(".chks").each(function () {
// $("[name='chks']").each(function () {
if ($(this).attr("checked")) {
CheckCount++;
}
});
alert(CheckCount);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input name="chks1" class="chks" type="checkbox" οnclick="security()" />
<input name="chks2" class="chks" type="checkbox" οnclick="security()" />
</div>
</form>
</body>
</html>
<head runat="server">
<title></title>
<script src="../scripts/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function security() {
var CheckCount = 0;
$(".chks").each(function () {
// $("[name='chks']").each(function () {
if ($(this).attr("checked")) {
CheckCount++;
}
});
alert(CheckCount);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input name="chks1" class="chks" type="checkbox" οnclick="security()" />
<input name="chks2" class="chks" type="checkbox" οnclick="security()" />
</div>
</form>
</body>
</html>