Hello with javascript I'm doing a function where I want to hide several elements, the problem is that if I use getElementById I can only select a single element, and I would like to hide several that have a similar ID; example, 'checkbox1', 'checkbox2'
Javascript function:
function activarcheck(){
var check = document.getElementById("checkbox");
if(check.style.display=== "none"){
check.style.display="block";
}else{
check.style.display="none";
}
}
html:
<td>
<div id="checkbox1"class="container oculto">
<input type="checkbox" autocomplete="off" disabled>
</div>
</td>
<td>
<div id="checkbox2" class="container oculto">
<input type="checkbox" autocomplete="off">
</div>
</td>