I have a collection of buttons, for which I am selecting using class name:
<button class="validator">One</button>
<button class="validator">Two</button>
<button class="validator">Three</button>
<button class="validator">Four</button>
<button class="validator">Five</button>
I know that I have 5 buttons in jQuery's array, because:
$(".validator").length;
// returns 5
Say for example I click button "Three", how do I get it's index in the array (which in this instance would be 2) ?
$(this).index();in the `click event (note zero based)