Hi
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function chkboxMeth() {
var chkbox = document.getElementById("CheckBoxList1");
var inputArr = chkbox.getElementsByTagName('input');
var labelArr = chkbox.getElementsByTagName('label');
var sum = "";
for (var i = 0; i < labelArr.length; i++) {
if (inputArr[i].checked == true) {
sum = sum + labelArr[i].innerText;
}
}
alert(sum);
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:CheckBoxList ID="CheckBoxList1" runat="server" AutoPostBack="True" BackColor="#00CC99" Font-Bold="True" ForeColor="#FF0066">
<asp:ListItem Value="1">Apple</asp:ListItem>
<asp:ListItem Value="2">Banana</asp:ListItem>
<asp:ListItem Value="3">Grapes</asp:ListItem>
</asp:CheckBoxList>
<asp:Button ID="Button1" runat="server" Style="position: absolute; z-index: 102; left: 400px; top: 48px;" Text="Click" OnClientClick =" return chkboxMeth()" BackColor="#CCCC66" Font-Bold="True" Width="64px"/>
</div>
</form>
</body>
</html>
Pls explain me these lines
var inputArr = chkbox.getElementsByTagName('input');
var labelArr = chkbox.getElementsByTagName('label');
I have nowhere mentioned in "input" , "label"
Thanks