How to prevent a click() event through a child div to a parent div in jQuery?

前端 未结 3 1703
谎友^
谎友^ 2021-01-01 09:06

Situation:

+ OPEN
3条回答
  •  暖寄归人
    2021-01-01 09:31

    $('.closeBtn').click(function (event){
       event.stopPropagation();
       //   ... your code here
       return false;
    });
    

    that should do the trick, so everytime you click on close it will not affect your header div,

提交回复
热议问题