Yeah but they’re not necessary for selection. Label elements actually need an input with ID to function. The other useful use for IDs is for deep-links in articles.
But then again that doesn’t mean the id should be used for selection (in JS nor CSS) as it’s probably easier to target many elements with a class, should they ever co-exist. This is basically what you end up with if you build components anyway (even without specific frameworks)
A few minification transforms actually kind of speed code up. If Babel hadn’t turned into a hydra this kind of transforms would have been right up its alley.
I know, that's why it's misleading and it should not be considered. A quick reader will think that "using getElementById will save me 32ms", but it'd be off by several orders of magnitude.
querySelector *does not* take 62ms to run. Both of them take 0.01ms at most, try it yourself. This is the sort of micro optimization you should not concern yourself with.
How often do you need to select unique elements by ID? Don't use IDs in the first place.
This is akin to using `i--` in loops to "speed up your code" — we're past that.
- too many street names make for a noisy/busy/ugly map, and we all know maps must be beautiful and nothing else
- streets don’t pay for ads, businesses do, so between the two they prefer showing the latter.
Technically now you can tap anywhere on the map once to place a pin and get more info; In practice tapping in Google Maps has become horrendous, it never does what you expect. One such example is tapping on a business near a “walkable area”: you can’t. The area will always focus instead, even if painted behind the business.
I remember some browser blocking that at some point, but I still occasionally see it. I can’t believe there’s no way to “go back to the previous website” in most browsers. Safari iOS for example just clips the history so you can’t even hold the back button and scroll up if there are dozens of entries.
I think “companies” have run out of the “benefit of the doubt” as far as I’m concerned. Using the web has become a pain not because companies don’t care about UX, but because they think popup X will increase profits — and it often does.
Certainly there’s a good amount of ignorance in every company, but many choices are purposeful.
My internet-first bank’s passwords are limited to 8 characters. I'd take password rules over this idiocy any day. I reported it maybe 5 years ago and of course radio silence. I bet they plaintext it.
Oh and of course I also have literally 4 different digit-based pins to do operations.
Congrats on getting them to use a password manager, now everyone can see all of their password by typing in the master password they stuck to the side of the screen.
I'm only half-joking sadly, people just don't understand why password exist in the first place, so they comply maliciously.
But then again that doesn’t mean the id should be used for selection (in JS nor CSS) as it’s probably easier to target many elements with a class, should they ever co-exist. This is basically what you end up with if you build components anyway (even without specific frameworks)