I have a loop that creates 20 check-boxes in the same page (it creates different forms). I want via chrome developer tools to
(function() {
var aa= document.getElementsByTagName("input");
for (var i =0; i < aa.length; i++){
if (aa[i].type == 'checkbox')
aa[i].checked = true;
}
})()
With up to date browsers can use document.querySelectorAll
(function() {
var aa = document.querySelectorAll("input[type=checkbox]");
for (var i = 0; i < aa.length; i++){
aa[i].checked = true;
}
})()