I have an element nested in another element. I have a mouseover event registered on the outer element. It fires both when my mouse enters the outer element, and when it enters the inner element. How can I turn off the event firing on the inner element?
I have an element nested in another element. I have a mouseover event registered
Share
Events fire on objects then bubble up the DOM tree. But you can stop them from bubbling with
event.stopPropagation(). This only works on standards-compliant browsers (not all but the most recent versions of IE).IE’s version will be:
So altogether: