<title>jQuery事件</title>
<script src="../jQuery-2.1.0/jquery-2.1.0.js"></script>
<script>
$(function(){
$("button:eq(0)").click(function(){
$("p").bind("mouseover mouseout",[1,2,3],function(event){
alert(event.data[1]);
});
});
$("button:eq(1)").click(function(){
//$("p").unbind();
$("p").unbind("mouseout");
});
});
</script>
</head>
<body>
<button>绑定事件</button>
<button>解除事件绑定</button>
<p>p标签</p>
</body>
<script src="../jQuery-2.1.0/jquery-2.1.0.js"></script>
<script>
$(function(){
$("button:eq(0)").click(function(){
$("p").bind("mouseover mouseout",[1,2,3],function(event){
alert(event.data[1]);
});
});
$("button:eq(1)").click(function(){
//$("p").unbind();
$("p").unbind("mouseout");
});
});
</script>
</head>
<body>
<button>绑定事件</button>
<button>解除事件绑定</button>
<p>p标签</p>
</body>