JSFiddle - React, Tailwind, and code Playground

HTML

<button id='test' type="button" onclick="example()">
  <div>
  Hello
  </div>

JavaScript

var e = document.getElementById('test');
e.onclick = example;

var example = function( {
	alert("hello");
});