JSFiddle - React, Tailwind, and code Playground

HTML

<div id='d'>
ololol
</div>

CSS

div {
  width:100%;
  height:100%;
}

JavaScript

var a = document.getElementById('d');
    
a.onclick = function() {
  console.log('onclick');
}

a.onmousedown = function() {
  console.log('onmousedown');
}

a.onmouseup = function() {
  console.log('onmouseup');
}

document.getElementById('d').click();