jQuery Tutorial
jQuery mouseout binds handler to execute functionalities when mouse moves out of the binded element.
<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>jQuery mouse out event handler</title> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $("div").mouseout(function () { $(this).text("mouse is out of div!"); }); }); </script> </head> <body> <div style="height:200px;width:200px;background-color:blue;color:white"> Mouse move in this area </div> </body> </html>Output:
Move the mouse to out of the div "Move mouse in this area" to update text of div as 'mouse is out of div!'.
In jQuery, mouseleave event handler is also useful to do the functionalities when leave the mouse out of the binded element.
$(document).ready(function () { $("div").mouseleave(function () { $(this).text("mouse is inside of div!"); }); });« Previous Next »
jQuery Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page