实现代码:

$("#three").click(function(event) {
           event.stopPropagation();
   });

a.写入event.stopPropagation(); 

   事件处理过程中,阻止了事件冒泡,但不会阻击默认行为

b.写入return false;

   事件处理过程中,阻止了事件冒泡,也阻止了默认行为

c.写入event.preventDefault(); 

   事件处理过程中,不阻击事件冒泡,但阻击默认行为

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
猜你喜欢
  • 2021-12-17
  • 2021-12-17
  • 2021-08-14
  • 2021-12-17
  • 2021-12-17
  • 2022-12-23
相关资源
相似解决方案