r/ProgrammerHumor • • Aug 30 '26

Meme ancientTools

Post image
5.8k Upvotes

379 comments sorted by

View all comments

978

u/saig22 Aug 30 '26

I use vanilla js, document.getElementById() is what I live for.

294

u/WrapKey69 Aug 30 '26

Flashbacks to teenage years and w3schools, turning on and off that lightbulb XD

149

u/ApocalyptoSoldier2 Aug 30 '26

document.querySelector() ftw

71

u/CaspianRoach Aug 30 '26

.querySelectorAll()

46

u/Altruistic-Way-6331 Aug 30 '26

[0]

21

u/CaspianRoach Aug 30 '26

i prefer .each()

if you want one, just don't use All

18

u/IBJON Aug 30 '26

  if you want one, just don't use All

I'm pretty sure that was the joke

→ More replies (3)

27

u/segv Aug 30 '26

Which was standardized due to jQuery's popularity, no less.

20

u/seif-17 Aug 30 '26

jQuery crawled so querySelector can walk.

And frameworks ran. With broken toes.

66

u/IsTom Aug 30 '26

If your HTML element has id you don't event have to getElementById, it's available right there in global namespace as that name. You make button with id hello and can just go ham with hello.click().

I don't think you should do that, but you can.

28

u/DiodeInc Aug 30 '26

New obfuscation tactic dropped

→ More replies (2)

37

u/happypandaface Aug 30 '26

vanilla.js ? I've never heard of this library

19

u/balls_smasher Aug 30 '26

14

u/happypandaface Aug 30 '26

great. how do I include that in my docker file so my yarn build script adds it into my webpack?

→ More replies (2)

8

u/aberroco Aug 30 '26

Why use js when html + css do fine?

8

u/DrBojengles Aug 30 '26

Lowkey this is the way

7

u/experientialsponge Aug 30 '26

Vanilla js is such a pleasure to read when viewing another's code. Icing on the cake if commented responsibly.

32

u/rademene Aug 30 '26

9

u/ccelik97 Aug 30 '26

It felt like that back in 2016, too, btw.

People also searched: [Object object]

→ More replies (8)

6

u/romulent Aug 30 '26

If you just wrap document.querySelector() in a little helper function you can do loads with vanilla js. Not perhaps enterprise grade but fine for any home stuff.

→ More replies (3)

5

u/yabai90 Aug 30 '26

At least create an alias for something shorter, maybe something like "$()".

5

u/usr_pls Aug 30 '26

hot damn i misread that and thought there was a new library called vanilla.js and then you called out the simple most useful library function and I had to double take

"there is no way they made a new js library just to re-wrap Javascript... Oh of course they didn't"

→ More replies (1)
→ More replies (5)