Now in my JS Code I want a function which check/uncheck all other checkboxes under it.
Obviously its something like : document.getElementById("Serial1").checked=true;
But Serial1 is not known actually. I want to know what are the numbers - like Serial23, Serial65, Serial 11 etc - its not in any order.
getElementByNames will give the collection which can be evaluated but is there any way to do it using getElementById ?
Thanks
The HTML part goes something like this :
<INPUT TYPE=checkbox ID=SerialAll onClick="CheckUnCheckAll(this)">
<INPUT TYPE=checkbox ID=Serial5>
<INPUT TYPE=checkbox ID=Serial9>
<INPUT TYPE=checkbox ID=Serial7>
<INPUT TYPE=checkbox ID=Serial12>
<INPUT TYPE=checkbox ID=Serial15>
<INPUT TYPE=checkbox ID=Serial19>
<INPUT TYPE=checkbox ID=Serial35>
<INPUT TYPE=checkbox ID=Serial40>
<INPUT TYPE=checkbox ID=Serial66>
<INPUT TYPE=checkbox ID=Serial82>
In CheckUnCheckAll()
Serial5 to Serial82 must be checked
{
var box = frmCodes.elements[srcObj];
for(var x = 0, y = box.length; x < y; x++)
box[ x ].checked = true;
}