robodesign at gmail.com
Fri Feb 3 02:25:01 PST 2006
On Fri, 03 Feb 2006 10:48:47 +0200, Gervase Markham <gerv at mozilla.org>
> Brad Fults wrote:
> If you have:
> <p class="foo bar">Fred</p>
> <p class="bar foo">Barney</p>
> <p class="foo baz bar">Wilma</p>
> which should be picked up by getElementsByClassName("foo bar")?
> In the "string split" mode, it would pick up all three. However, I
> suggest that designers might be misled by this interface into thinking
> that it only picks up the first one - which matches exactly.
> So I think a multiple-argument interface would remove this possible
> confusion, and make things more obvious than a whitespace-splitting
> getElementsByClassName("foo", "bar") ideally, but if that's hard, then
> getElementsByClassName(["foo", "bar"]);
> So I agree with Brad, I think :-)
I wouldn't go for:
Because that's not ideal in my opinion, since that makes harder to add an
arbitrary number of classes to search for programatically.
I would go for:
But, as you said, that can add some confusion. Therefore, this is ideal:
ROBO Design - We bring you the future
More information about the whatwg