December 2013
Intermediate to advanced
384 pages
9h 54m
English
$("p").on("mouseover", function (e){ $(this).html("Hello mouse."); }); $("p").on("mouseout", function (e){ $(this).html("Wait, don't go."); });
The browser provides an event each time the mouse enters or leaves an element. The standard JavaScript events are mouseover and mouseout, so you can use .on("mouseover") to add an event handler for the mouse entering an element and .on("mouseout") to add an event handler for when the mouse leaves.
Read now
Unlock full access