Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
feat(node.js): add append method
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Dec 25, 2016
1 parent 3257c8f commit 1850902
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -289,7 +300,7 @@ class Node {
*/
appendChildAfter(newChild, existingChild) {
domUtils.append(existingChild.get(), newChild.get())

return this
}

Expand Down

0 comments on commit 1850902

Please sign in to comment.