W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2011

Node append

From: Erik Arvidsson <arv@chromium.org>
Date: Thu, 15 Sep 2011 12:37:13 -0700
Message-ID: <CAJ8+GohRM5zd=ZDsHC6AOPq2FJCBisP=0oAnXhkgW=GJh09Grw@mail.gmail.com>
To: www-dom@w3.org
Cc: Ojan Vafai <ojan@chromium.org>
This is something that the centithreads regarding Element.create
reminded me of...

It would be useful to add an append method to the Node interface. It
would work as the rest args in Element.create where it would just
append Nodes to the end of the childNodes and it would toString() and
create Text nodes for everything else.

var element = ...;
element.append(otherNode, "some text", 42, {toString: function() {
return 'x' }});

On this topic, it would be useful if the current DOM methods
(appendChild, insertBefore and replaceChild) could all be changed to
support Strings too.

erik
Received on Thursday, 15 September 2011 19:37:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:08 GMT