lundi 4 juillet 2016

Get the checkbox in which div was clicked using javascript?

If I have two divs with checkboxes in each of them, how can I find out - checkbox in which div was clicked?

<div id="num-1">
<input type="checkbox" name="check-1" value="check-1"> Checkbox "check-1" of the Div "num-1" <br>
</div>

<div id="num-2">
<input type="checkbox" name="check-1" value="check-1"> Checkbox "check-2" of the Div "num-2" <br>
</div>

I would be gratefull if you advice me a method, that uses JS (not JQuery).




Aucun commentaire:

Enregistrer un commentaire