AJAX
Basics
Data
DOM
Effects
Events
Forms
jQuery UI
Plug Ins
Traversing
The jQuery mouseeneter()
and mouseleave()
events
automatically wired up an (anonymous) function to the mouseover() and mouseout()
properties of the selected element.
Click on each of these alerts.
$("#alert1").mouseenter(function () { $("#demo1").html("entering alert 1"); });
$("#alert1").mouseleave(function () { $("#demo1").html("leaving alert 1"); });
//Javascript method
document.getElementById("alert2").addEventListener("mouseover", function () { document.getElementById("demo1").innerHTML = "entering alert 2"; });
document.getElementById("alert2").addEventListener("mouseout", function () { document.getElementById("demo1").innerHTML = "leaving alert 2"; });