jQuery | mouseenter() with Examples
The mouseenter() method is an inbuilt method in jQuery which works when mouse pointer moves over the selected element.
Syntax:
$(selector).mouseenter(function)
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:
Example:
<!DOCTYPE html> <html> <head> <title>The mouseenter Method</title> <script src= </script> <!-- jQuery code to show the working of this method --> <script> $(document).ready(function() { $("p").mouseenter(function() { $("p").css("background-color", "green"); }); }); </script> <style> body { width: 300px; padding: 40px; height: 30px; border: 2px solid green; font-weight: bold; font-size: 20px; } </style> </head> <body> <!-- move over this paragraph and see the change --> <p>Welcome to GeeksforGeeks!</p> </body> </html> |
Output:
Before enters the mouse over the paragraph:

After enter the mouse over the paragraph:

Related Articles:
Recommended Posts:
- jQuery | eq() with Examples
- jQuery | has() with Examples
- jQuery | last() with Examples
- jQuery | on() with Examples
- jQuery | after() with Examples
- jQuery | one() with Examples
- jQuery | first() with Examples
- jQuery | val() with Examples
- jQuery | index() with examples
- jQuery | focus() with Examples
- jQuery | wrapInner() with Examples
- jQuery | hasClass() with Examples
- jQuery | Add Elements with Examples
- jQuery | mousedown() with Examples
- jQuery | prependTo() with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



