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);
1<img onmouseover="enlargeImage(this)" border="0" src="smiley.gif" alt="Smiley" width="32" height="32">
2
3<script>
4function enlargeImage(x) {
5 x.style.height = "64px";
6 x.style.width = "64px";
7}
8</script>