diff --git a/base.js b/base.js new file mode 100644 index 0000000..a5b69cf --- /dev/null +++ b/base.js @@ -0,0 +1,5 @@ +// Select a DOM element +const select(selector, all=false) { + let selector = selector.trim(); + return all ? [...document.querySelectorAll(selector)] : document.querySelector(selector); +}