Skip to content
Related Articles

Related Articles

Improve Article

jQuery | mouseover() with Examples

  • Last Updated : 13 Feb, 2019

The mouseover() method is an inbuilt method in jQuery which works when mouse pointer moves over the selected elements.



Parameters: This method accepts single parameter function which is optional. This parameter is used to specify the function to run when the mouseover event is called.

Return Value: This method returns the selected element with the change.

Below example illustrates the mouseover() method in jQuery:


<!DOCTYPE html>
        <title>The mouseover Method</title>
        <script src=
        <!-- jQuery code to show the working of this method -->
            $(document).ready(function() {
                $("p").mouseover(function() {
                    $("p").css("background-color", "lightgreen");
            body {
                width: 280px;
                padding: 40px;
                height: 30px;
                border: 2px solid green;
                font-weight: bold;
                font-size: 20px;
        <!-- move over this text to see the change -->
        <p>Welcome to GeeksforGeeks!</p>

Before mouse move over the paragraph:

After moving mouse over the paragraph:

Related Articles:

My Personal Notes arrow_drop_up
Recommended Articles
Page :