Node append

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 UTC