1
Hello, folks, please, I have the following checkbox:
<ul class="nav">
<li>
<div>
<label>Motivo de não informar o nome da mãe</label>
<br/>
<input class="messageCheckbox" type="checkbox" id="checkMaeDesconhecida" name="nomeMaeDesc[1][]" value="1"> Desconhecido
<input class="messageCheckbox" type="checkbox" id="checkNaoTemMae" name="nomeMaeDesc[1][]" value="2"> Não tem
<input class="messageCheckbox" type="checkbox" checked id="checkMaeNaoInformada" name="nomeMaeDesc[1][]" value="3"> Não Informado
</div>
</li>
</ul>
I know this JS command takes the value of my selected combos:
document.querySelector('.messageCheckbox:checked').value
however, I need, if none is selected, I can get some value (type 0). How do I do this?
Thanks, man, your solution I think I was in too, but I found the example of Felipe more suitable for my project, was more relaxed to implement... Quarrel!!
– Renan