I would like to know what a condition to uncheck all my ckeckbox
.
function marcarDesmarcarTodos() {
for (i = 0; i <= 500; i++) {
document.getElementById('seleciona_ativarDesativar_'+i).checked = true;
}
}
I tried it the following way, but it did not work.
function marcarDesmarcarTodos() {
for (i = 0; i <= 500; i++) {
if (document.getElementById('seleciona_ativarDesativar_'+i) != 'checked') {
document.getElementById('seleciona_ativarDesativar_'+i).checked = true;
} else {
document.getElementById('seleciona_ativarDesativar_'+i).checked = false;
}
}
}