3 ms·
My personal microframework: const node = (tag = 'div', attributes = {}, inner) => { const e = document.createElement(tag); for(const [key,
by schindlabua 8y ago
My personal microframework:
const node = (tag = 'div', attributes = {}, inner) => {
const e = document.createElement(tag);
for(const [key, value] of Object.entries(atrributes))
e.setAttribute(key, value);
if(inner) e.innerHTML = inner;
return e;
};
The premium version contains an additional:
e.child = (a,b,c) => { const f = node(a,b,c); e.appendChild(f); return f; };