From 1850902945f28f5af4f42f5d0b85f13207ed46d5 Mon Sep 17 00:00:00 2001 From: stfsy Date: Sun, 25 Dec 2016 18:57:19 +0100 Subject: [PATCH] feat(node.js): add append method --- lib/node.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/node.js b/lib/node.js index 88acc2c..9657872 100644 --- a/lib/node.js +++ b/lib/node.js @@ -257,6 +257,17 @@ class Node { return this } + /** + * Add a node as this nodes next sibling + * @param {nextNode} node the node to be added + * @returns {this} + */ + append(nextNode) { + domUtils.append(this._element, nextNode.get()) + + return this + } + /** * Replaces a child element with a new child * @param {Node} newChild the new Child @@ -289,7 +300,7 @@ class Node { */ appendChildAfter(newChild, existingChild) { domUtils.append(existingChild.get(), newChild.get()) - + return this }