3 ms·
I've been using this for years – it's not the end of web development but an awful lot of projects don't need more framework than can fit in a tweet: let $
by acdha 8y ago
I've been using this for years – it's not the end of web development but an awful lot of projects don't need more framework than can fit in a tweet:
let $ = (selector, scope=document) => {
return scope.querySelector(selector);
};
let $$ = (selector, scope=document) => {
return Array.from(scope.querySelectorAll(selector));
};
- schindlabua 8y agoMy 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; };