W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2004

[whatwg] [WA1] getElementsByClass

From: Ian Hickson <ian@hixie.ch>
Date: Sun, 29 Aug 2004 17:04:59 +0000 (UTC)
Message-ID: <Pine.LNX.4.61.0408291703480.8458@dhalsim.dreamhost.com>
On Thu, 26 Aug 2004, Mark Schenk wrote:
>
> I'm very happy to see the getElementsByClass() method introduced in WA1, 
> that is definitely something missing from current DOM specs. However, 
> there seems to be no way defined for selecting elements with multiple 
> class names.
> 
> <div class="green" />
> <div class="green car" />
> <div class="car green" />
> <div class="car green british" />
> 
> What happens if I want to select all elements with class="car green" 
> (and that selection should include the equivalent class="green car")? 
> That is currently undefined. And let's assume that this was implemented 
> and if I were to search for getElementsByClass("car green") would it 
> also select the fourth one? Or should it only select completely matching 
> classes?

I've changed the definition a little. Is it more to your liking?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Sunday, 29 August 2004 10:04:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:47:29 GMT