Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: To set all checkboxes to true using JavaScript?
Answer: //select all input tags
function SelectAll() {
var checkboxes = document.getElementsByTagName("input");
for(i=0;i if(checkboxes.item(i).attributes["type"].value == "checkbox") {
checkboxes.item(i).checked = true;
}
}
}
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook