JSFiddle - React, Tailwind, and code Playground

by naoise

HTML

<a class="button" href="#">Button 1</a><br>
<button class="button">Button 2</button>

JavaScript

// Hide modal if "Okay" is pressed
$('.button').click(function(e) {
    e.preventDefault();
    alert(e.target.firstChild.wholeText); 
    //use firebug to see all available atributes that 'e' gives
    console.log(e);
});