Hacker News new | past | comments | ask | show | jobs | submit login

True. Maybe I've not put it clear: neither the article nether me were arguing for separated elements. The so called best practice here is exactly as you put it: nest the elements but (sadly) duplicate the relation in attributes, in order to make the two screen readers / voice controls happy.

I've brought up it here just because parent comment stated what perhaps majority of developers believe:

> [nesting] completely avoids [possible gaps in the UI areas] and you don't need to come up with a unique id to use with 'for'.

As for separated elements here, I can imagine scenarios when we need them too (for example if you need to shuffle them in some way, or intend to use a pseudo element of the label), but as noted, it is rarely best solution and requires way more scrutiny and complexity.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: