var e = event || window.event; var x = parseInt(e.clientX); var y = parseInt(e.clientY); Image1.style.left = x + "px"; Image1.style.top = y + "px"; Label5.innerHTML = parseInt(x)+'|'+parseInt(y);