I have an HTML page with multiple checkboxes.
I need one more checkbox by the name "select all". When I select this checkbox all checkboxes in the HTML page must be selected. How can I do this?
checkboxhtmljavascriptselectall
I have an HTML page with multiple checkboxes.
I need one more checkbox by the name "select all". When I select this checkbox all checkboxes in the HTML page must be selected. How can I do this?
Best Answer
UPDATE:
The
for each...in
construct doesn't seem to work, at least in this case, in Safari 5 or Chrome 5. This code should work in all browsers: