mouseover() Method - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:mouseover


The mouseover() method triggers the mouseover event, or sets function as mouseover event handler.


Parameter Require Description
function Optional. function to run when the mouseover event is triggered

The following code shows how to set the background color to yellow, when the mouse pointer is over a <p> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<script src=""></script>
        $("p").css("background-color", "yellow");
    });//ww w  . j  ava  2 s  .c  o m
        $("p").css("background-color", "lightgray");

<p>Move the mouse pointer over this paragraph.</p>


Related Tutorials