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

Reply via email to