JSFiddle - React, Tailwind, and code Playground

HTML

<div class="box"></div>
<button>click me</button>

CSS

body{
    margin:0;
}
.box{
    width:100px;
    height:100px;
    background-color:rgba(0,0,0,0.5);
}

JavaScript

var e = new jQuery.Event("click");
e.pageX = 10;
e.pageY = 10;
$("button").click(function(){
    $(document).trigger(e);
});
$('.box').click(function(){
    $(this).css('background-color','#000');
});