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

Javascript examples for jQuery Method and Property:bind

Description

Bind 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").bind("mouseover mouseout", function(){
        $("p").toggleClass("intro");
    });// w  w  w.  j  a v  a2 s . c  o  m
});
</script>
<style>
.intro {
    font-size: 150%;
    color: red;
}
</style>
</head>
<body>

<p>Hover the mouse pointer over this paragraph.</p>

</body>
</html>

Related Tutorials