JSFiddle - React, Tailwind, and code Playground

HTML

<div id='click'>Click me</div>

JavaScript

$('#click').click(function(){
    $('<div>',
      {
        class:'newOne',
        text: 'hi there'
      }
     ).click(function(){
        console.log(this)
     }).appendTo('#click');
});