This is my code :
HTML
<div id="myDiv">
Hello
</div>
CSS
#myDiv
{
width:200px;
height:100px;
background-color:red;
}
jQuery
$("#myDiv").mousemove(function (e) {
console.log($(this).offset().left);
});
it says always "0". Where am I wrong?
Try this.
This worked for me 🙂