$$('p', $('article')) returns all <p> elements in the first <article>, not all <p>s that are children of <article>s. For that you'd still have to do $$("article > p")
HTMLElement.prototype.has = HTMLElement.prototype.hasAttribute doesn't bind the function properly, so this will not work properly
your .text() function should use .textContent not .innerText
HTMLElement.append should still check to see if child is an instance of Node, even if it's not an HTMLElement
Same with HTMLElement.prototype.prepend
Also HTMLElement.prototype.prepend, already exists
HTMLElement.prototype.remove already exists too
HTMLElement.prototype.parent should return .parentElement
HTMLElement.prototype.emit should have args=null as a parameter and use new CustomEvent(event, { detail:args })
Pellentesque nec neque ex. Aliquam at quam vitae lacus convallis pulvinar. Mauris vitae ullamcorper lacus. Cras nisi dui, faucibus non dolor quis, volutpat euismod massa. Donec et pulvinar erat.
Some notes:
$$('p', $('article'))returns all<p>elements in the first<article>, not all<p>s that are children of<article>s. For that you'd still have to do$$("article > p")HTMLElement.prototype.has = HTMLElement.prototype.hasAttributedoesn't bind the function properly, sothiswill not work properly.text()function should use.textContentnot.innerTextHTMLElement.appendshould still check to see ifchildis an instance ofNode, even if it's not anHTMLElementHTMLElement.prototype.prependHTMLElement.prototype.prepend, already existsHTMLElement.prototype.removealready exists tooHTMLElement.prototype.parentshould return.parentElementHTMLElement.prototype.emitshould haveargs=nullas a parameter and usenew CustomEvent(event, { detail:args })HTMLElement.prototype.appendandNodeList.prototype.forEachalready exist, too.Thanks I fixed the things you said in updated gist. Why does text need to return textContent and not innerText?
innerTextis a lot more performance heavy and triggers layout to be recalculated.stackoverflow.com/a/35213639/5203655
AFAIK,
innerTextis also non-standard (originally IE-only) whereastextContentis part of the standard.