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? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -