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

[whatwg] DOMTokenList methods would be more useful with a space separated token list

From: Aryeh Gregor <ayg@aryeh.name>
Date: Fri, 28 Oct 2011 12:42:15 -0400
Message-ID: <CAKA+Axmdqc-89W=yhrqScno5DqWuW1RjT_7pRnXmjVSkVchs5A@mail.gmail.com>
On Fri, Oct 28, 2011 at 12:07 PM, Mike Taylor
<michaelaarontaylor at gmail.com> wrote:
> I would prefer if it returned the DOMTokenList, to enable chaining like:
>
> ? foo.toggle('bar baz').remove('bat');
>
> Same for the rest of the DOMTokenList methods, as well.
>
> ? foo.add('bar').remove('baz');
>
> See also https://github.com/jquery/standards/issues/13 for relevant
> discussion.

This is not how existing DOM methods tend to behave, but in general I
support adding it in more places, because it's very useful for methods
that mutate the object they're called on.
Received on Friday, 28 October 2011 09:42:15 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:37 UTC