diff --git a/ajquery.js b/ajquery.js index 0ad0405..5841bd5 100644 --- a/ajquery.js +++ b/ajquery.js @@ -1,7 +1,7 @@ -function $(sel, el) { - return (el || document).querySelector(sel); +function $(sel, $parent = document) { + return $parent.querySelector(sel); } -function $$(sel, el) { - return Array.from((el || document).querySelectorAll(sel)); +function $$(sel, $parent = document) { + return Array.from($parent.querySelectorAll(sel)); }