javascript - Multiple "not" conditions in prototype $$ CSS selector - Stack Overflow

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

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 another 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'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 another 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.

Share Improve this question asked Jan 17, 2011 at 18:58 Madison WilliamsMadison Williams 3501 gold badge4 silver badges11 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

I don't know why you need the class attribute, that is what a . selector is for. You can ma 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 ma?

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745216821a4617062.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信