JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" value="Test" id="x"/>

JavaScript

function testFunc(){
            alert("onmouseup called");
 }
 
 document.getElementById('x').addEventListener('mouseup', testFunc);
 document.getElementById('x').onmouseup();