开发者

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 *)")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜