AJUDA HABILITA E DESABILITA DIVS
Ola pessoal estou tentando desabilitar mais de uma div com um unico checkbox
estou tentando fazer issso
<html>
<head>
<script>
function verificaEmpr(amp){
var div = document.getElementById('di'+ emp.id);
var div2 = document.getElementById('di2'+ emp.id);
if (emp.checked == true) {
div.style.display = 'block';
div2.style.display = 'block';
} else {
div.style.display = 'none';
div2.style.display = 'none';
}
}
</script>
<style>
.cl_est{
margin-top: 20px;
margin-left: 50px;
display: none;
}
</style>
</head>
<body>
<form id="frm1" name="nm_frm1">
<div>
<input type="checkbox" id="e1" name="nm_ea" onClick="verificaEmpr(this);" />
Empresa A
</div>
<div class="cl_est" id="die1">
<input type="checkbox" id="a1" /> Estabelecimento 1 <br />
</div>
<div class="cl_est" id="di2e1">
<input type="checkbox" id="a1" /> Estabelecimento 2 <br />
</div>
</form>
</body>
</html>
mais nao funciona alguma dica
Discussão (1)
Carregando comentários...