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.

Received on Thursday, 15 September 2011 19:37:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:18 UTC