jQuery bind() bind event map

Description

jQuery bind() bind event map

View in separate window

<!DOCTYPE html>
<html>
<head>
<script 
 src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>/*from w  w w  . j  ava2s .  c o m*/
<script>
$(document).ready(function(){
  $("button").bind({
    click:function(){$("p").slideToggle();},
    mouseover:function(){$("body").css("background-color", "blue");},
    mouseout:function(){$("body").css("background-color", "#FFFFFF");}
  });
});
</script>
</head>
<body>

<p>This is a paragraph.</p>

<button>Click me!</button>

</body>
</html>



PreviousNext

Related