JSFiddle - React, Tailwind, and code Playground

HTML

<button type="button" name="confirm" onclick="validate();return false;">Validate</button>

JavaScript

/**
*
* Validate the input.
*/
window.validate = function() {
  alert("hi");
}