Javascript examples for jQuery Method and Property:on
handle mouse over and out event
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("p").on("mouseover mouseout", function(){ $(this).toggleClass("intro"); });/*from www .j a v a 2s . c o m*/ }); </script> <style> .intro { font-size: 150%; color: red; } </style> </head> <body> <p>Move the mouse pointer over this paragraph.</p> </body> </html>