Suppose I have these elements :
<div class="myClass" id="class_3"> </div>
<div class="myClass" id="class_1"> </div>
<div class="NOTTHIS"> </div>
<div class="myClass" id="class_0"> </div>
<div class="myClass" id="class_2"> </div>
how can I get faster with jQuery the index of the element class_0 valutating only the elements with class myClass
In the example should be 2, not 3!
Using
index()method, as simple as that: