I have a list of check boxes made by JS with same class that every each of them is inside a separated div. i need to find out the place number of specific check box between all same class named check boxes inside a div.
For example
<div class="div_a1">
<input type="checkbox" name="aaa" class="a1">title1
</div>
<div class="div_a2">
<input type="checkbox" name="aaa" class="a2">title2
</div>
<div class="div_a1">
<input type="checkbox" name="aaa" class="a1">title3
</div>
<div class="div_a4">
<input type="checkbox" name="aaa" class="a4">title4
</div>
<div class="div_a2">
<input type="checkbox" name="aaa" class="a2">title5
</div>
<div class="div_a3">
<input type="checkbox" name="aaa" class="a3">title6
</div>
<div class="div_a1"> <-- user this div is clicked
<input type="checkbox" name="aaa" class="a1">title7
</div>
<div class="div_a4">
<input type="checkbox" name="aaa" class="a4">title8
</div>
<div class="div_a5">
<input type="checkbox" name="aaa" class="a5">title9
</div>
And I can get the number "3", because I clicked on the div element of the third checkbox named class "div_a1".
Aucun commentaire:
Enregistrer un commentaire