W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2006

[whatwg] getElementsByClassName()

From: Dean Edwards <dean@edwards.name>
Date: Mon, 23 Oct 2006 23:01:03 +0100
Message-ID: <453D3B9F.5080605@edwards.name>
Ian Hickson wrote:
> On Mon, 23 Oct 2006, Jonathan Worent wrote:
>> When asked if they would prefer a comma separated list or an array, 
>> there were mixed feelings. Three indicated a preference to a comma 
>> separated list, the other said he would expect to pass an array. Given 
>> this I would suggest not using a space delimited list.
> 
> Ok, that's a compelling argument. I've removed the string version. We're 
> down to just the array form now. If people want to call the method with a 
> single class, they have to use square brackets; if they want to call it 
> with a space-separated list of classes, they have to use .split() or some 
> such.
> 

Personally, I prefer a comma delimited list. Passing an array seems yukky.

Are there any problems with passing a JavaScript array to a DOM method?
Does it cast to a DOMArray or something? What about other platforms?

-dean
Received on Monday, 23 October 2006 15:01:03 UTC

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