Collections of IDs
Posted: Fri Oct 01, 2004 11:24 am
I have this :
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
Code: Select all
<INPUT TYPE=checkbox ID=SerialAll onClick=CheckUnCheckAll()>
while (...)
{
$row=mysql_fetch_assoc(...);
echo '<INPUT TYPE=checkbox ID='.$rowї'Serial'].'>';
}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