Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#26 Match elements that DON'T have the specified attribute.

open
nobody
None
5
2014-02-17
2011-05-20
Anonymous
No

[attribute] Matches elements that have the specified attribute.
[attribute=value] Matches elements that have the specified attribute with a certain value.
[attribute!=value] Matches elements that don't have the specified attribute with a certain value.
[attribute^=value] Matches elements that have the specified attribute and it starts with a certain value.
[attribute$=value] Matches elements that have the specified attribute and it ends with a certain value.
[attribute*=value] Matches elements that have the specified attribute and it contains a certain value.

It would be nice to have:
[!attribute] Matches elements that DON'T have the specified attribute.

Discussion

  • nickl-
    nickl-
    2012-09-11

    It would help if this was based on some standard selector architecture. Is this possible in some way with css or xpath or the likes. Instead of defining our own standards which is rather dangerous territory. If you rely on this now and a new library comes out you would be stuck with the hybrid.

    New specs are better taken up with the IETF and/or W3C not at the implementation, would you agree?

     
  • John Schlick
    John Schlick
    2012-10-10

    I can see utility in this when looking at dom subtrees like a list.

    Please propose a syntax that makes sense when compared to our current syntax.