1.0.0 • Published 9 years ago
append-child v1.0.0
append-child 
Append an HTML element to the DOM and return a removal function
Install
$ npm install --save append-childUsage
var appendChild = require('append-child')
var element = document.createElement('div')
var remove = appendChild(element)
//=> div appended to body
remove()
//=> div removed from bodyAPI
appendChild(element, [parent]) -> function
Returns a remove function.
element
Required
Type: HTMLElement
A DOM element to insert.
parent
Type: HTMLElement
Default: document.body
The parent element to append to.
License
MIT © Ben Drucker
1.0.0
9 years ago