handle mouse over and out event - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:on

Description

handle mouse over and out event

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials