[whatwg] getElementsByClassName()

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