W3C home > Mailing lists > Public > public-html@w3.org > August 2008

Re: DOMStringMap - get keys, et length?

From: Thomas Broyer <t.broyer@gmail.com>
Date: Wed, 6 Aug 2008 22:49:59 +0200
Message-ID: <a9699fd20808061349kae92e2bo2d6f19af40e12741@mail.gmail.com>
To: "public-html@w3.org" <public-html@w3.org>

On Wed, Aug 6, 2008 at 8:10 PM, Jeff Schiller wrote:
>
> Also, I seem to remember seeing text in the HTML5 spec to the effect that:
>
> <span id="foo" data-bar="baz" />
>  alert( document.getElementById("foo").dataset.bar );
>
> would spit out "baz".  I guess this was removed in favor of the
> DOMStringMap interface?

dataset is a DOMStringMap, which defines XXX1 as a [NameGetter], so
dataset.bar is equivalent to dataset.XXX1("bar")

http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#domstringmap
http://www.w3.org/TR/html5/dom.html#domstringmap

-- 
Thomas Broyer
Received on Wednesday, 6 August 2008 20:50:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:21 GMT