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

After moving mouse over the paragraph:

Related Articles:
Recommended Posts:
- Difference between mouseover, mouseenter and mousemove events in JavaScript
- jQuery | jQuery.fx.interval Property with example
- jQuery | jQuery.fx.off Property
- jQuery | jQuery.support Property
- jQuery | jquery Property
- jQuery | prepend() with Examples
- jQuery | dblclick() with Examples
- jQuery | offset() with Examples
- jQuery | children() with Examples
- jQuery | Hide/Show, Toggle and Fading methods with Examples
- jQuery | focusin() with Examples
- jQuery | Animation, Slide methods with Examples
- jQuery | change() with Examples
- jQuery | filter() with Examples
- jQuery | height() and innerHeight() with Examples
- jQuery | eq() with Examples
- jQuery | empty() with Examples
- jQuery | not() method with Examples
- jQuery | first() with Examples
- jQuery | parent() & parents() 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.


