if (!window.paso) window.paso = {}
if (!paso.function) paso.function = {}
paso.function.createElem = (tag, attrs, children) => {
const el = document.createElement(tag)
if (attrs) Object.entries(attrs).forEach(([k, v]) => el.setAttribute(k, v))
if (Array.isArray(children)) {
el.append.apply(el, children)
} else if (typeof children === 'string') {
el.innerHTML = children
}
return el
}


Back to home | File page

Subscribe | Register | Login | N