diff --git a/js/dom.js b/js/dom.js index 3dfaa164..969dc5c0 100644 --- a/js/dom.js +++ b/js/dom.js @@ -12,7 +12,7 @@ for (const type of [NodeList, NamedNodeMap, HTMLCollection, HTMLAllCollection]) } $.remove = (selector, base = document) => { - const el = selector instanceof Node ? selector : $(selector, base); + const el = selector && typeof selector === 'string' ? $(selector, base) : selector; if (el) { el.remove(); }