JSFiddle - React, Tailwind, and code Playground

by bunker1

HTML

<button id="button">button</button>

JavaScript

document.addEventListener('DOMContentLoaded', function () {
  document.querySelector('button').addEventListener('click', showalert());
});

    function showalert() {
        alert("you just pressed the button");
    }