How to checked all checkbox by javascript and except some checkbox ref by id ?
On my code. When press button. All checkbox will checked.
But i want to except not checked checkbox id 111 and id 222
How to do ?
<script>
function js_fn() {
var all_checkbox_inputs = document.getElementsByTagName("input");
for (var i = 0, max = all_checkbox_inputs.length; i < max; i++){
if (all_checkbox_inputs[i].type === 'checkbox')
all_checkbox_inputs[i].checked = true;
}
}
</script>
Aucun commentaire:
Enregistrer un commentaire