check!
Here are a couple checkboxes, just to try it:
Here's the code, de-minified:
(function(){
//all inputs on the page
var cbs=document.getElementsByTagName('input');
//the value for the checked (true of false)
var cv;
//the current checkbox
var cb;
for(var i in cbs){
cb=cbs[i];
if(cb.type=='checkbox'){
if(cv==null)
cv = !(cb.checked);
cb.checked=cv;
}
}
void(0); //prevent the bookmarklet from switching pages
})() //call the anonymous function
To get this bookmarklet, just drag it to your bookmarks toolbar or your bookmarks area. Click it whenever you want to use it.
No comments:
Post a Comment