JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<button style="z-index: 2000;" class="clear" onclick="clear()">Clear</button>
</body>
JavaScript
$(document).ready(function(){
$(this).mousedown(function(e){
$x = e.pageX;
$y = e.pageY;
$div = "<div class='theDiv' style='width: 250px; height: 150px; background-color:#e7e7e7; position: absolute; top:" + $y + "px; left:" + $x + "px;'>Hey</div>";
$("body").prepend($div);
});
function clear() {
$(".theDiv").remove();
}
})