
同时设置不同层的事件会叠加
$(function () {
$(".one").click(function () {
console.log(event.target)
console.log(event.currentTarget)
//禁用方法1:
// return false;
//方法2:
//event.stopPropagation;
//event.currentTarget谁触发的事件
//event.target;//谁被触发了(触发的目标)
if (event.target == event.currentTarget) {
alert("one");
}
})
评价
排名
31
文章
25
粉丝
11
评论
6
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术