JSFiddle - React, Tailwind, and code Playground

HTML

<body>
<a href="#" >asl;kdfjl</a>
    <div id="my-button">sdgdf</div>
</body>

JavaScript

$('body').on('click','a',function(e){
    e.preventDefault();
    createMyButton();
});

createMyButton = function(data) {

    $('a').after('<div id="my-button">test</div>');
    
};
    $('body').on('click','#my-button',function (e) {
      alert("yeahhhh!!! but this doesn't work for me :(");
});