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

[whatwg] getElementsByClassName()

From: Gervase Markham <gerv@mozilla.org>
Date: Tue, 24 Oct 2006 10:20:01 +0100
Message-ID: <453DDAC1.3020503@mozilla.org>
Dean Edwards wrote:
> var menus = document.getElementsByClassName("menu");
> 
> That is much more intuitive for the most common case.

Why not allow a string in the single class name case, but require an 
array for multiple class names?

Alternatively, we could make it more obvious that it takes an array by 
calling it
document.getElementsByClassNames(["...", "..."]);
This gives a little hint, and is a more accurate description of what the 
function does.

Gerv
Received on Tuesday, 24 October 2006 02:20:01 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:49 UTC