JSFiddle - React, Tailwind, and code Playground

HTML

<div>
<button>
<div class="classname">
The button
</div>
</button>
</div>
<div id="id">
The Div
</div>

JavaScript

setTimeout(function(){ 

$("#id").prev('div').find('button').click(function(){
alert("Testing");
});


}, 3000);