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