JSFiddle - React, Tailwind, and code Playground

by cathead

HTML

<button>hello</button>

JavaScript

document.addEventListener('click', function(event) {

  if (event.target.tagName == 'BUTTON') {
    alert('test');
  }

});