# Wednesday, March 07, 2007
« I added an AboutMe section | Main | Reusable IComparer »
Sometimes it's the simple things that make you go wow!  I just ran into one of those today while reading up on better HTML/CSS usage, I found there's an HTML element just for providing labels for input control.

Here's an example:

<label for="loanNumber">Loan Number</label>
<input id="loanNumber" type="text"/>



Not only does this render side by side, but its more obvious and provides semantic meaning.  Another cool thing is that when you click on the label text in your browser, then input control associated with becomes activated, try it!


Wednesday, March 07, 2007 10:43:32 PM (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [1]  |  Related posts:
Testing JavaScript Made Easy

Thursday, March 22, 2007 5:16:15 AM (GMT Standard Time, UTC+00:00)
This is the intent of the asp.net Label control. It has a 'AssociatedControlID' property that renders as the 'for' attribute of the label element. I just learned this myself and have been using it like crazy.
MIKE
Comments are closed.