ref!: use default parameters to break compatibility with older browsers
This commit is contained in:
parent
be92cb7aa2
commit
8084f8ff30
|
@ -1,7 +1,7 @@
|
||||||
function $(sel, el) {
|
function $(sel, $parent = document) {
|
||||||
return (el || document).querySelector(sel);
|
return $parent.querySelector(sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
function $$(sel, el) {
|
function $$(sel, $parent = document) {
|
||||||
return Array.from((el || document).querySelectorAll(sel));
|
return Array.from($parent.querySelectorAll(sel));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue