[JavaScript] Comparison of MouseEnter MouseLeave MouseOver MouseOut
onmouseenter / onmouseleave event of a DOM element will be triggered only when the mouse cursor enters / leaves the element:
Demo of MouseEnter & MouseLeave event
onmouseover / onmouseout event of a DOM element will be triggered not only when the mouse cursor enters / leaves the element, but also when the mouse cursor enters / leaves sub-elements of the element.
Demo of MouseOver & MouseOut event
See also: [JavaScript] onMouseEnter and onMouseLeave Suppport for Old Browsers
References:
[1] | Mouse Events - QuirksMode |
[2] | javascript - What is the difference between the mouseover and mouseenter events? - Stack Overflow |