Latest web development tutorials

jQuery mouseover () method

jQuery Event Methods jQuery Event Methods

Examples

When the mouse pointer is <p> element at the top, set the background color to yellow:

$("p").mouseover(function(){
$("p").css("background-color","yellow");
});

try it"

Definition and Usage

When the mouse pointer is located at the top of the element, mouseover event occurs.

mouseover () method triggers the mouseover event or add a function to run when the event mouseover event.

Note: Unlike mouseenter different events, mouseover event when the mouse pointer enters the selected element or any child elements will be triggered, mouseenter event only when the mouse pointer enters the selected element is triggered.See the bottom of the page presentation instance.

Note: This event is usually associated with mouseout use incident.


grammar

Trigger the selected element mouseover events:

$(Selector) .mouseover () try

Add the function to the mouseover event:

$(Selector) .mouseover (function) try

parameter description
function Optional. Mouseover function run when a predetermined trigger event.


Examples

More examples

Different mouseover () and mouseenter () between
Different Demo mouseover () and mouseenter () between.


jQuery Event Methods jQuery Event Methods