JQuery——事件的绑定和移除

版权声明:本文为博主原创文章,欢迎各位转载,但须注明出处 https://blog.csdn.net/qq_34202873/article/details/86759235

JQuery——事件的绑定和移除

1.单事件绑定

在这里插入图片描述

<script type="text/javascript">
	$(function(){
		$("input[name=event_1]").bind("click",function(){
			$("p").css("background-color","#F30");
		});
	});
</script>

2.多事件的绑定

在这里插入图片描述

<script type="text/javascript">
	$(function(){
		$("input[name=event_1]").bind({
			mouseover:function(){
				$("ul").css("display","none");
			},
			mouseout:function(){
				$("ul").css("display","block");
			}
		});
	});
</script>

3.事件的移除

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_34202873/article/details/86759235
今日推荐