@soil/dom
Version:
Declaratively create type-safe HTML and SVG elements.
12 lines • 338 B
JavaScript
/**
* Add children to the given element.
*/
export function addChildren(elem, children) {
for (var i = 0; i < children.length; ++i) {
var child = children[i];
elem.appendChild(typeof child === 'string'
? document.createTextNode(child)
: child);
}
}
//# sourceMappingURL=addChildren.js.map