javascript - get what element the mouse is over with the mousemove event on the body -
if use mousemove
event on body tag. possible element in html mouse over.
$('body').mousemove(function (e) { var details = e; // can e.something return element mouse cursor over? console.log(details); });
you can use event.target
for getting id use
var id = event.target.id;
use can check using this
var $target = $(event.target); if ($target.is("a")) { }
Comments
Post a Comment