开发者

Multiple "not" conditions in prototype $$ CSS selector

I'm trying to exclude two cases in my CSS selector. Currently the selector looks like this:

$$('select:not([class=session])').each(function(){
    //blah blah
})

But i want to exclude anoth开发者_StackOverflow社区er class named "sessionproperties"

Is there any way to exclude more than one in a single selector statement? Any help on this is appreciated.

note: I've tried using the ~= operator for the word "session" but it totally does not work for me.


I don't know why you need the class attribute, that is what a . selector is for. You can comma separate sub selectors in the :not just like you can when you define them in your stylesheet.

$$('select:not(.session, .sessionproperties)').each(function() {
 ...
})


Prototype supports CSS3 syntax selectors,

So why not try the comma?

$$('select:not([class=session]), select:not([class=sessionproperties]').each(function(){
    //blah blah
})
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜