JSFiddle - React, Tailwind, and code Playground

HTML

<body>

</body>

JavaScript

$(function(){
	//$('body').on('click', '.foo', function(event) {
  //	alert('loren ipsum');
  //});
  
  $('.foo').on('click', function(event) {
  	alert('loren ipsum');
  });

	var testBlock = jQuery('<div/>', {
  	class: 'foo',
    id: 'bar',
    style: 'width: 100px; height: 100px; background:black'
  });
  
  $('body').append(testBlock);
})