JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<button>
Click Me! Click Me!
</button>
<p>
Hello
</p>
</div>
JavaScript
$(document).ready(function() {
var Person = function(first, last, secret) {
this.first = first;
this.last = last;
this.secret = secret;
}
var guy = new Person("Bruce", "Wayne", "Batman");
var click = function(person) {
$(this).closest('div').find('p').text(person.first + " " + person.last + " is " + person.secret);
};
$("div").on('click', 'button', click;
});