<input id="inp" type="button" value="click">
<div id="myDiv"></div>
<script>
inp.onmousedown = function() {
document.onmousemove = function() {
myDiv.innerHTML = 'x: ' + event.clientX + '<br>' + 'y: ' + event.clientY
}
}
document.onmouseup = function() {
document.onmousemove = null
}
</script>