JSFiddle - React, Tailwind, and code Playground

HTML

<body>
    <script>
        function testFunc() {
            alert("onmouseup called");
        }

        function testFunc2() {

            document.getElementById("x").onmouseup();
        }
    </script>
    <input type="button" value="Test" id="x" onmousedown="testFunc2()" onmouseup="testFunc()" />
    <script>
        document.getElementById("x").onmouseup();
        document.getElementById("x").onmousedown();
    </script>
</body>