addeventlistener mouseenter mouseleave code example
Example 1: js mouse enter
mouseTarget.addEventListener('mouseenter', e => {
mouseTarget.style.border = '5px dotted orange';
});
Example 2: mouseout vs mouseleave js event
The mouseout event triggers when the mouse pointer leaves any
child elements as well the selected element.
The mouseleave event is only triggered when the mouse pointer
leaves the selected element.