JSFiddle - React, Tailwind, and code Playground

by j08691

HTML

<section>
    <a href="#">test 1</a>
</section>

<section>
    <a href="#">test 2</a>
</section>

<section>
    <a href="#">test 3</a>
</section>

JavaScript

$('section a').on('click', function(e) {
    alert( $.inArray(e.target, $('section a')) );
});