boast-init
Version:
The initialisation script for the boast product
14 lines (13 loc) • 361 B
JavaScript
var build = function build(element, attributes, text) {
var ele = document.createElement(element);
if (attributes && attributes.length > 0) {
attributes.forEach(function (att) {
if (att.name && att.value) {
ele.setAttribute(att.name, att.value);
}
});
}
if (text) ele.innerHTML = text;
return ele;
};
export default build;