jquery基础事件的绑定用法

时间:2020-03-31 13:06:21   收藏:0   阅读:52

jquery基础事件的绑定用法

<div>www.dc3688.com</div>

1,bind用法

$("div").bind("click",function(){

  alert(‘‘);

})

2,简写的用法

$("div").click(function(){

alert("a");

})

3,多事件绑定用法

$("div").bind("mouseenter mouseleave", function() {

 $(this).toggleClass("entered");
});
$("div").bind({
 click: function() {
  // do something on click
 },
 mouseenter: function() {
  // do something on mouseenter
 }
});

原文:https://www.cnblogs.com/96net/p/12602954.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!