What do you mean you can just bareback calling an HTML element in javascript without declaring a variable for it or chaining off getElementById()?!

How long has this been the case and I didn't know?? I mean, it's a bad idea in general and I'm not going to do it, but what the hell?

Literally nothing talks about this unless you already know it's true and go looking for why. I guess there's a good reason for that: it's a terrible idea to rely on it.

@trysdyn Your guess is exactly correct - this used to be a more common practice in the bad old IE6 days, if I remember correctly, especially with form elements, but at some point people realized that this was generating bugs like nobody's business and so it got functionally deprecated by the broader webdev community

@trysdyn (There's a pretty big collection of very cursed old browser stuff that we're all collectively pretending doesn't exist, because Never Break The Web means that it cannot *actually* be removed)

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.