JSFiddle - React, Tailwind, and code Playground

HTML

<body>
<button style="z-index: 2000;" class="clear" id="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);
	});
    
    $('#clear').click(function(e){
        e.preventDefault();
        $(".theDiv").remove();
    });
	
})