Skip to content

Comment on All you need is PHP and jQueryparent

Comments

I don't really get why someone would use JQuery, still. My experience with fixing old codebases is JQuery is difficult to write in a way that prevents bugs when moving html elements. That seems like a complete nonstarter. Selectors are extremely brittle. You're either selecting by ID or you're traversing up and down the DOM and hoping that never changes.

I'm aware this is how people did it for a long time, but we surely have better "simple" tools now. Maybe Svelte, Hyperscript, etc

You can get a lot of value doing const $ = document.querySelector, $$ = document.querySelectorAll;

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.