Personally I need to check all my system checkboxes using javascript, however I want to checkboxes through the id, how do I do this? I'm doing it this way, but it's not working:
function marcarTodos(marcar,cont){
var id = document.getElementById(cont);
if(marcar){
document.getElementById(id).innerHTML = 'Desmarcar Todos';
}else{
document.getElementById(id).innerHTML = 'Marcar Todos';
}
var i = 0;
for(i=0; i<id.length;i++){
id[i].checked = marcar;
}
}