ref!: use default parameters to break compatibility with older browsers

This commit is contained in:
AJ ONeal 2024-08-29 14:10:40 -06:00
parent be92cb7aa2
commit 8084f8ff30
No known key found for this signature in database
GPG Key ID: F1D692A76F70CF98
1 changed files with 4 additions and 4 deletions

View File

@ -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));
}