Skip to content
Related Articles

Related Articles

jQuery | mouseenter() with Examples

View Discussion
Improve Article
Save Article
  • Last Updated : 13 Feb, 2019
View Discussion
Improve Article
Save Article

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



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

Return Value: This method returns the selected elements with the changes made by the mouseenter() method.

Below example illustrates the mouseenter() method in jQuery:


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

Before enters the mouse over the paragraph:

After enter the mouse over the paragraph:

Related Articles:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!