Any advice how to console.log the element that fired an hover action?
This is only for debugging a strange behavior I’m on on iOS.
I don’t need to find the item on which action was performed, but who is performing the action.
For example on a simple mouse hover I want to console.log the mouse.
Using native javascript, the
window.eventobject is populated when an event fires, and theevent.srcElementwill give you DOM object that fired the event.Using jQuery, the
thisreference inside an event handler will also give you the DOM object that handled the event.Neither of these will tell you that
mouseoverwas fired by a mouse, but they will give the DOM elements involved.