News for hackers. Stuff that matters.
Re:A little bit of plain JavaScript can do a lot by austincheney on Sunday June 21, 2020 @03:35AM (#23590496)
I also have custom DOM helpers I carry around with me:

* getNodesByType - allows me to get things like attributes, text, and comments directly

* getAncestor - allows me to get a specified element somewhere between a target element and the document.documentElement

Re:A little bit of plain JavaScript can do a lot by felixfbecker on Sunday June 21, 2020 @05:54AM (#23591044)
getAncestor is built-in: element.closest() :)
Re:A little bit of plain JavaScript can do a lot by austincheney on Sunday June 21, 2020 @10:45AM (#23592283)
Slow. It uses a selector as an argument, which requires a parse step. It doesn’t take much effort to write something substantially better.