- I want to get onclick of page position(x and y) along with scroll values if the page got any scrolls
And also want the below jquery code as javascript code:
$("#drag").mouseup(function(event){ var x = event.pageX - $(this).offset().left; var y = event.pageY - $(this).offset().top; $("#pos").html(x + ', ' + y); });
<div id="drag" style="width:2000px;height:2000px;border:1px solid #000; top:100px; left:100px; position:absolute; background-color: #AACCEE">
</div>