$('html').click()… anywhere except one element

前端 未结 4 1866
孤城傲影
孤城傲影 2021-02-05 05:52

I have a dynamically appended menu which I am removing if you click anywhere on page including the menu links itself. What I am trying to achieve is to prevent the remove if yo

4条回答
  •  轮回少年
    2021-02-05 06:25

    have you tried this:

    $('.menu a').click(function(event){
       event.stopPropagation();
    });
    

提交回复
热议问题