- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Mon, 1 Aug 2011 20:43:28 -0700
- To: Charles Pritchard <chuck@jumis.com>
- Cc: Ian Hickson <ian@hixie.ch>, Maciej Stachowiak <mjs@apple.com>, WebApps WG <public-webapps@w3.org>
On Mon, Aug 1, 2011 at 7:05 PM, Charles Pritchard <chuck@jumis.com> wrote:
> Can we have it 'inherit' a parent namespace, and have chaining properties?
>
> Element.create('div').create('svg').create('g').create('rect', {title: 'An svg rectangle in an HTML div'});
Ooh, so .create is defined both on Element (defaults to HTML
namespace, just creates an element) and on Element.prototype (defaults
to namespace of the element, inserts as a child)? That's pretty
interesting. Presumably the new element gets inserted as a last child
of the parent.
I like it.
~TJ
Received on Tuesday, 2 August 2011 03:44:14 UTC