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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -