JSFiddle - React, Tailwind, and code Playground

HTML

<div id='btn'>Click this button</div>

JavaScript

$('<button />', {
    'attr': 'button',
    'text': 'Button',
    'css': {
    '    cursor': 'pointer'
    }
}).appendTo('#btn').click(function(){
    
    alert('clicked');
    
});