W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2005

[whatwg] getElementsByClassName()

From: Anne van Kesteren <fora@annevankesteren.nl>
Date: Sun, 04 Sep 2005 18:51:43 +0200
Message-ID: <20050904185143.yazp61uq0b6sskg4@webmail.annevankesteren.nl>
Quoting Kornel Lesinski <kornel at ideadesigners.com>:
> It will also solve IMHO unclear case of getElementsByClassName("foo 
> bar")  matching "bar foo". It would, as opposed to behavior where 
> space is both  separator and part of class name.

This is not how the CLASS attribute works. "foo bar" means the element has two
classes bound to it, "foo" and "bar". With your syntax,
getElementsByClassName("bar foo") would also need to match an element 
with "foo
bar" as value for the CLASS attribute.

Kind regards,

Anne


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
Received on Sunday, 4 September 2005 09:51:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:24 UTC