prevent all elements within a div from being selected. \
开发者_如何学Pythoni am trying to prevent all elements within a div from being selected. this is not working.
$('*').not('#someid > *')
The only problem with your approach is that you're asking for immediate children. If you remove the > it should work fine:
$('*').not('#someid *');
Use filter():
$("*").filter(function() {
return !$(this).closest("#someid").length;
})
...actually doing some more testing, this should also work:
$("*:not(#someid *)")
加载中,请稍侯......
精彩评论