Yes it is possible.
document.querySelector("button").addEventListener("click",function(){
[].forEach.call(document.querySelectorAll('input[type="checkbox"]'),function(el){
el.checked = !el.checked //Invert
});
}, false);
No matter the checkboxes are created dynamically or not, this code will still work because it does not even need any id or class.
For IE:
document.getElementsByTagName("button")[0].addEventListener("click", function(){
var ele = document.getElementsByTagName("input");
for(var i=0;i<ele.length;i++){
if(ele[i].type == "checkbox"){
el.checked = !el.checked //Invert
}
}
});
Ultimate jQuery solution!
$("button").click(function(){
$("input[type=checkbox]").each(function(){
this.checked = !this.checked;
}
});
LIVE DEMO: http://jsfiddle.net/DerekL/jfeAd/