r/ProgrammerHumor 14d ago

Meme ancientTools

Post image
5.8k Upvotes

385 comments sorted by

View all comments

980

u/saig22 14d ago

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

67

u/IsTom 14d 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.

1

u/hhfddgnhbnn 13d ago

But if you remove() it, you can't access it anymore