Firstly, you're going to have to use mouse events. Mouse events contains properties such as clientX, clientY, pageX, pageY, offsetX, offsetY, screenX, screenY. Look up the difference. These are read-only properties and display coordinates based on what kind of property they are.
So basically you can pretty much create an element, make the position absolute, and set the top and left properties using the mouse events properties such as pageX and pageY.
Adding a function
document.body.setAttribute('onclick', 'myFunction(event)');
Then creating the element
function myFunction(ev){
var div = document.createElement('div');
div.id = '12';
div.className = '11';
div.style.position = 'absolute';
div.style.height = '100px';
div.style.width = '100px';
div.style.backgroundColor = 'cornflowerblue';
div.style.top = ev.pageY;
div.style.left = ev.pageX;
var body = document.getElementsByTagName('body');
body[0].appendChild(div);
//you can easily destroy in 2 seconds using set timeout
setTimeout(function(){
body[0].removeChild(div);
}, 2000)
}
Try it. This code will create a div element in the position where you click your mouse.