JSFiddle - React, Tailwind, and code Playground

HTML

<button id="myButton" onclick="alert('Hello world!')">Click Me</button>

JavaScript

// Get the button element
  var button = document.getElementById("myButton");

  // Remove the onclick event
  button.onclick = null;