samedi 25 avril 2015

How to know which index in the class is clicked


Looking at this link , I was thinking classes are actually indexed. If I have this code, how can I get in JavaScript or jQuery the index of the class of the button clicked?

<button class="class_name" id="b1"></button>
<button class="class_name" id="b2"></button>


Aucun commentaire:

Enregistrer un commentaire