News for hackers. Stuff that matters.
Re:Obscure HTML tags that you should know and even use by yan on Saturday February 14, 2009 @09:59AM (#481145)
They need to add 'label' to that list. It's not really obscure, but not enough people use it; not even the big sites (ahem, eBay.) It adds a good amount to the usability to the page, in my opinion.

('label' associates another block of text/html with an input field. So if something says: Name: |_________|, and Name is wrapped in the label tag, clicking on Name is enough to give the textbox focus)

Re:Obscure HTML tags that you should know and even use by Hexstream on Saturday February 14, 2009 @10:55AM (#481192)
Yeah, label is great.

You can associate a label with any element without having to nest the element in the label too; just use label's for attribute with the element's ID. It's useful, for example, if you want the labels in one column and the form controls in another.

Make sure to have the label take the maximum available space; if you have a label centered in a table cell you want the label to span the whole cell so it's easier to click on it to select the associated control.

Re:Obscure HTML tags that you should know and even use by LogicHoleFlaw on Saturday February 14, 2009 @06:33PM (#481535)
Once I started using <label> for all my forms, I became quite keenly aware of others' forms which don't use it. It's extremely convenient.

edit: http://htmldog.com/ has great tutorials on modern and complete form building. It's a fantastic resource.

Re:Obscure HTML tags that you should know and even use by weaksauce on Saturday February 14, 2009 @12:32PM (#481248)
Other than making the site more usable for people that can see, the label tag can also make the site more usable for blind people or anyone using screen readers. When you associate the label with a input field then the screen reader will know what to read for a particular input field. This is accomplished by adding a for="idOfInputField" to the label.