Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I have to think about labeling a input (why is this not an attribute ?)

If input labels were html attributes, forms would be much less versatile. It would merge 2 visual elements into one, which would make it hard to adjust the display (think of inputs with right-aligned labels to their left, or checkboxes with labels to their right). And a "label" attribute would mean a plain text content... Seems awfully restrictive to me.

Granted, HTML has a complex history and several layers, like anything that's been in use for decades. But it hasn't changed much recently, and (thanks, MDN) it's easy to learn learn enough to identify what is possible with HTML5 and dig later if necessary.



I don't understand the following. Would you be kind enough to elaborate ?

>And a "label" attribute would mean a plain text content.


You can't put html elements in an attribute. It's just plain text.




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

Search: