# javascript如何阻止click事件连续触发

- URL: https://wuming.si/blog/1152/
- Author: Aaron
- Published: 2016-03-29
- Language: zh-Hans
- Categories: Technology
- Originally published at: https://blog.wo.ai/archives/1152

在

中包含一个checkbox，点击时不仅激活checkbox的click事件，还会激活td或者tr的click事件，称作bubble event。 解决方法是： $(“table tbody td”).click(function(e){  
if(e.target.nodeName.toUpperCase() == “INPUT”){  
alert(“It’s an input!”);  
return;  
}else{  
alert(“It’s not an input!”);  
}  
});
