jquery: get mouse click if inside a div or not

后端 未结 6 1123
栀梦
栀梦 2020-12-29 08:46

i have this HTML page



a
b
c
d
6条回答
  •  [愿得一人]
    2020-12-29 09:02

    Maybe this one will help you

    $('body').click(function(){
        //do smth
    });
    $('div#in_or_out').click(function(e){
        e.stopPropagation();
        // do smth else
    });
    

提交回复
热议问题