HNHacker News
TopNewBestAskShowJobs

StreamingCat

9 karma · joined July 7, 2023

submissionscomments
StreamingCat··on You may not need jQuery
Mainly because the vanilla append/prepend functions require that you create an element first, then insert it at the desired position. The ease of use of jQuerys string to html node isnt matched by vanilla js in these functions.

The closest you would get is this: https://developer.mozilla.org/en-US/docs/Web/API/Element/ins... But the jQuery prepend/append functions are still easier to read and shorter to write.

StreamingCat··on You may not need jQuery
I think the css vs query selector debate really boils down to personal preference.

Especially in combination with modern frontend frameworks, complex frontend libraries like jQuery can cause all sorts of chaos. I remember it breaking one of my personal projects a while back that was using AngularJS.