JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript">
function get_position(e){
//ie
if(document.all){
curX = event.clientX;
curY = event.clientY;
}
//netscape 4
if(document.layers){
curX = e.pageX;
curY = e.pageY;
}
//mozilla
if(document.getElementById){
curX = e.clientX;
curY = e.clientY;
}
}
function new_div(pobj,e){
get_position(e);
newdiv=document.createElement("div");
newdiv.style.position="absolute";
newdiv.width=curX+'px';
newdiv.height=curY+'px';
newdiv.style.background="yellow";
sample = document.createElement("p");
sample.innerHTML = "lorem ipsum dolorem";
newdiv.appendChild(sample);
document.body.appendChild(newdiv);
alert("new div");
}
</script>
</head>
<body onmousedown="new_div(this,event);">
<p>Pookah boo</p>
</body>
</html>