JSFiddle - React, Tailwind, and code Playground

by Adrien Antoine

HTML

<div class="topClass">
    <div class="classNameone">
        <p>bit of schpiel about section 1</p>
        <a href="#" class="Button">click me!</a>
    </div>
    <div class="classNametwo">
        <p>bit of schpiel about section 2</p>
        <a href="#" class="Button">click me!</a>
    </div>
</div>

JavaScript

$('a').click(function(){
    alert( $(this).parent().parent().find('.Button').index(this) );
});