jQuery的bind()的三种使用方式事件监听

bind的三种使用方法
1:直接的加方法名和 函数(可以是匿名函数也可以是一般函数)
2:一次性的添加多个事件名,使用同一个处理函数
3:添加对个函数,每个函数一个处理函数。
</pre><pre name="code" class="html">移除事件监听 可以直接加事件名
</pre><pre name="code" class="html">
</pre><pre name="code" class="html"><!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script  src="js/jquery.js">
			
		</script>
	</head>
	<body>
		<input type="button" value="按钮" />
	</body>
	<script type="text/javascript">
		alert($("input[value=按钮]")[0].value)
		
		$("input[value=按钮]").bind('click',function(){
			alert("fujichao")
		})
//		$('input').bind('mouseover mouseout',function(){
//			alert("fuji")
//		})
		
		
//		$('input').bind({
//			mouseover:function(){
//				alert('fu')
//			},
//			mouseout:function(){
//				alert('2')
//			}
//		})
		
		$('input').bind('click',function(){
			alert("fuji ")
		})
		$('input').bind({
			
		})
<span style="white-space:pre">		</span><p style="margin-top: 0px; margin-bottom: 0px; font-size: 15px; line-height: normal; font-family: Consolas; color: rgb(6, 6, 6);"><span style="white-space:pre">	</span>$(<span style="color: #289c97">'input'</span>).unbind()</p>
	</script>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值