JSFiddle - React, Tailwind, and code Playground
HTML
<div id="test"></div>
CSS
#test{
background-color:red;
position:absolute;
top: 0;
left:0;
width:100%;
height:100%;
}
JavaScript
document.documentElement.addEventListener('mousedown', function(){
document.getElementById("test").style.backgroundColor = "#ff0";
});
document.documentElement.addEventListener('mouseup', function(e){
alert('mouseup')
});