Samuel Liew’s Blog

News, events, and other interesting finds

Paste this in the browser address bar to select all checkboxes on a page:

javascript:el=document.getElementsByTagName('input');for(i=0;i<el.length;i++){if(el[i].type=="checkbox")el[i].checked=true;}void(0);

Paste this in the browser address bar to un-select all checkboxes on a page:

javascript:el=document.getElementsByTagName('input');for(i=0;i<el.length;i++){if(el[i].type=="checkbox")el[i].checked=false;}void(0);

Note that the above scripts won’t work for pages displayed in a frame (iframe or frameset).

You may also like: