Is it possible to get the current element using mousemove ? I’d like to get the element where the mouse is to do specifics things if the mouse isn’t on an element x or y.
For exemple :
$(document).mousemove(function(e)
{
if(e.xxxx.attr("id") == "elem")
...
});
xxxx is what I’m looking for, and I hope it exists 🙂
Thanks
If you mean the element the mouse is over, yes, it’s available as the
targetproperty of the event object.targetis a DOM element, and you can access theidof the element directly from itsidproperty (a reflected property that takes its value from the attribute). If you wanted to do other things with it and wanted access to the jQuery functions, you’d use$(e.target)to get a jQuery wrapper for it.