How to know if a clicked element is inside a main one with jQuery?
This question already has an answer here:
你可以试试这个 -
$(document.body).on('click',function(e){
if(!$(e.target).closest('#main-space').length){
$('#main-space').hide();
}
});
链接地址: http://www.djcxy.com/p/14716.html
上一篇: 检查点击模式窗口内部或外部是否发生