top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to set all checkboxes to true in JavaScript?

+1 vote
427 views
How to set all checkboxes to true in JavaScript?
posted Apr 3, 2014 by Harshita Dhaliwal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Use the following code to achieve this:

function SelectAll() {
var checkboxes = document.getElementsByTagName("input");
for(i=0;i<checkboxes.length;i++) {
if(checkboxes.item(i).attributes["type"].value == "checkbox") {
checkboxes.item(i).checked = true;
}
}
}
answer Apr 7, 2014 by Pushpak Chauhan
Similar Questions
+5 votes

I need disable all refresh events

Example.

  1. F5,
  2. Mouse right click option (refresh/reload),
  3. CTRL+R,
  4. Menu bar -> view -> refresh and
  5. URL refresh/reload button

How to disable these all events by using javascript...

Advance thanks....

...