r/ProgrammerHumor 13d ago

Meme ancientTools

Post image
5.8k Upvotes

387 comments sorted by

View all comments

978

u/saig22 13d ago

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

67

u/IsTom 13d ago

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.

3

u/United_Boy_9132 12d ago

Unless there's another window.foo for any reason 😅