Javascript with <div>
Hi All
I have a page (no form) with a series of check boxes, I have 2 functions to select / deselect all.
Here is one of the functions
function doSelectAll()
{
var el = document.all;
for (var i=0; i < el.length; i++)
{
if (el[i].type == 'checkbox')
{
el[i].checked = true;
}
}
}
All the checkboxes are in a table in a div, I also have other checkboxes on the page that I don't want to select.
How do I modify my script to only act on the div or table, and not the whole page. I know the problem is with my document.all but cant figure how to limit it.
Thanks
Andy G
|