AJAX
Basics
Data
DOM
Effects
Events
Forms
jQuery UI
Plug Ins
Traversing
Hover is simply a combination of mouseover and mouseout. jQuery combines the two and makes it a little easier to write. It takes two arguments which are the anonymous functions.
MouseOver each of these alerts.
//jQuery method
$("#alert1").hover(function () { $("#demo1").html("hovering over well 1"); }, function () { $("#demo1").html("leaving well 1"); });
//Javascript method
document.getElementById("alert2").addEventListener("mouseover", function () { document.getElementById("demo1").innerHTML = "entering well 2"; });
document.getElementById("alert2").addEventListener("mouseout", function () { document.getElementById("demo1").innerHTML = "leaving well 2"; });