3 ms·
You do opt into them, by using label. if you want an element with no behavior, that's what div and span are for.
by Touche 7y ago
You do opt into them, by using label. if you want an element with no behavior, that's what div and span are for.
- tenaciousDaniel 7y agoRight, but this offers two benefits: (1) semantic naming, and (2) composed functionality. So for example, if you wanted an element that exposes label behavior and list-item behavior, you could do that. With html, you have to use 2 elements: <li> <label> </li>
- Touche 7y agoYes, this is a major flaw of HTML, it is very specific about where certain elements can and cannot be, so you can't really even design a solution like the above.