-3
How do I get the values corresponding to DIV
clicked?`
Example of the first div if clicked, returns:
Aid = 1
aCodigo = 8477459164
aNome = Room
function vistoriaIniciar(object) {
let aID = object.document.getElementsByClassName('aID').value;
let aCodigo = object.document.getElementsByClassName('aCodigo').value;
let aNome = object.document.getElementsByClassName('aNome').value;
alert(aID +" - "+ aCodigo +" - "+ aNome);
}
<div id="divListaAmbientes" class="">
<div class="lista fade" onclick="vistoriaIniciar(this)">
<h1>Sala</h1>
<input class="aID" type="hidden" value="1">
<input class="aCodigo" type="hidden" value="8477459164">
<input class="aNome" type="hidden" value="Sala">
</div>
<div class="lista fade" onclick="vistoriaIniciar(this)">
<h1>Quarto</h1>
<input class="aID" type="hidden" value="2">
<input class="aCodigo" type="hidden" value="8477459164">
<input class="aNome" type="hidden" value="Quarto">
</div>
</div>
You were faster than me and worse than for that question there’s no other answer.
– Augusto Vasques
Luiz, thank you very much for your explanation!
– Tiago