5 ms·
> Is it common these days to nest inputs in labels? Been developing websites for almost 15 years now, and I recall this always being a common thing to do. > T
by jordanlev 10y ago
> Is it common these days to nest inputs in labels?
Been developing websites for almost 15 years now, and I recall this always being a common thing to do.
> To me that's conceptually as well as semantically broken, the two are separate things why is the input inside the label?
I agree that it's conceptually broken, but it is not semantically broken -- since the HTML5 spec and screen readers all recognize this as an equally valid way to define a label on an input.
So they're both equally "correct", just a trade-off of ease-of-styling (for some designs) vs. saving a few bytes and mental overhead of assigning for/id attributes to them.