<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="js/jquery-1.11.0.min.js.js" charset="UTF-8"></script>
<style>
#img{
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<img id="img" src="img/android-alarm.png" />
<br />
<input type="button" id="toggle" value="toggle" />
<br />
<input type="button" id="btn1" value="绑定事件" />
<input type="button" id="btn2" value="被绑定的按钮" />
<input type="button" id="btn3" value="解除绑定按钮" />
<input type="button" id="btn4" value="鼠标移入事件" />
</body>
<script type="text/javascript">
$("#toggle").click(function(){
$("#img").toggle(3000);
})
$("#btn1").click(function(){
$("#btn2").bind("click",function(){
alert("aaa")
})
})
$("#btn3").click(function(){
$("#btn2").unbind("click")
})
$("#btn4").mouseover(function(){
alert("aaa")
})
</script>
</html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="js/jquery-1.11.0.min.js.js" charset="UTF-8"></script>
<style>
#img{
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<img id="img" src="img/android-alarm.png" />
<br />
<input type="button" id="toggle" value="toggle" />
<br />
<input type="button" id="btn1" value="绑定事件" />
<input type="button" id="btn2" value="被绑定的按钮" />
<input type="button" id="btn3" value="解除绑定按钮" />
<input type="button" id="btn4" value="鼠标移入事件" />
</body>
<script type="text/javascript">
$("#toggle").click(function(){
$("#img").toggle(3000);
})
$("#btn1").click(function(){
$("#btn2").bind("click",function(){
alert("aaa")
})
})
$("#btn3").click(function(){
$("#btn2").unbind("click")
})
$("#btn4").mouseover(function(){
alert("aaa")
})
</script>
</html>