append-children
Append children to a DOM element.
Install
With npm do:
npm install --save append-children
Usage
var appendChildren = var element = document // append a single thing // append multiple things { var hello = document var world = document return hello ' ' world}
API
appendChildren(element, child)
Append a DOM element child
to another DOM element element
.
appendChildren(element, str)
Append a string str
to a DOM element element
.
A Text node will be created to contain the string.
RegExps, Dates and Numbers are converted to a string using toString()
.
appendChildren(element, arr)
Append multiple things to a DOM element element
.
arr
can be an array of any of the things accepted by the other forms.