1let test = document.getElementById("test");
2
3test.addEventListener("mouseover", function( event ) {
4 alert("mouse over test!")
5 , false);
1let test = document.getElementById("test");
2
3// This handler will be executed only once when the cursor
4// moves over the unordered list
5test.addEventListener("mouseenter", function( event ) {
6 // highlight the mouseenter target
7 event.target.style.color = "purple";
8
9 // reset the color after a short delay
10 setTimeout(function() {
11 event.target.style.color = "";
12 }, 500);
13}, false);