I want to go through all checkboxes (all inputs are checkboxes) on a page and uncheck them if they are checked. This is what I came up with:
My first instinct was to just do one of these:Code:checkboxes = document.getElementsByTagName('input'); for (var index = 0; index < checkboxes.length; index++){ checkboxes[index].checked = false; }
That of course doesn't work, but is there any other way to do something to all items in an array without using loops? Thanks!Code:checkboxes = document.getElementsByTagName('input'); checkboxes.checked = false; //or checkboxes[all].checked = false;



Reply With Quote

Bookmarks