Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Jquery选择器使用not_Javascript_Jquery_Jquery Ui_Jquery Selectors_Jquery Events - Fatal编程技术网

Javascript Jquery选择器使用not

Javascript Jquery选择器使用not,javascript,jquery,jquery-ui,jquery-selectors,jquery-events,Javascript,Jquery,Jquery Ui,Jquery Selectors,Jquery Events,我有一个具有类名的div.modalPopup在div中我有多个表,在表中我有div,在多个控件中,如文本框input和dropdownlistsselect 我想要的是,当用户单击主div上除dropdownlistselect之外具有modalPopup的任何位置时,我想要触发click事件。 我尝试使用我的选项,但无法获取特定的单击事件。 像这样: $('.modalPopup :not(modalPopup select)').click(function(){ docume

我有一个具有类名的div.modalPopup在div中我有多个表,在表中我有div,在多个控件中,如文本框input和dropdownlistsselect

我想要的是,当用户单击主div上除dropdownlistselect之外具有modalPopup的任何位置时,我想要触发click事件。 我尝试使用我的选项,但无法获取特定的单击事件。 像这样:

  $('.modalPopup :not(modalPopup select)').click(function(){
    document.write("working for click except select ");
    });

有谁能给我提供解决方案吗?

您以前缺少一个点。MODALPOUP处于not状态

$('.modalPopup :not(.modalPopup select)').click(function(){ document.write("working for click except select "); });

您之前缺少一个点。ModalPopp处于not状态

$('.modalPopup :not(.modalPopup select)').click(function(){ document.write("working for click except select "); });

最简单的方法是将div上的click事件与modalPopup类绑定,然后使用e.target检查用户实际单击的内容:

e、 target是已单击的dom元素$e、 is'select'获取该dom元素并从中创建一个jQuery对象,并检查它是否为select


最简单的方法是将div上的click事件与modalPopup类绑定,然后使用e.target检查用户实际单击的内容:

e、 target是已单击的dom元素$e、 is'select'获取该dom元素并从中创建一个jQuery对象,并检查它是否为select


你能解释一下吗$e、 目标。是“选择”。我非常感谢你…如果你愿意,你能解释一下吗$e、 目标。是“选择”。我非常感谢你…我在这里打字时想念多特。。我找到了解决办法。谢谢你的帮助。我在这里打字的时候想念点了。。我找到了解决办法。谢谢你的帮助。