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(){
alert('mousedown');
});

document.documentElement.addEventListener('mouseup', function(e){
alert('mouseup')
});