loading...

re: Use $ & $$ Instead of document.querySelector/All in JavaScript without jQuery VIEW POST

FULL DISCUSSION
 
const $ = (selector, base = document) => {
   let elements = base.querySelectorAll(selector);
   return (elements.length == 1) ? elements[0] : elements;
}
Code of Conduct Report abuse