Blog Of Sem: Chrome console check all checkbox in page

Chrome console check all checkbox in page

var getInputs = document.getElementsByTagName("input");
for (var i = 0, max = getInputs.length; i < max; i++){
if (getInputs[i].type === 'checkbox'){

if (getInputs[i].name === 'checkall'){
getInputs[i].checked = false;} else

getInputs[i].checked = true;
}}



var getInputs = document.getElementsByTagName("input");
for (var i = 0, max = getInputs.length; i < 850; i++){
if (getInputs[i].type === 'checkbox'){

if (getInputs[i].name === 'checkall'){
getInputs[i].checked = false;} else

getInputs[i].checked = true;
}}

No comments:

Post a Comment