E-mail List Archives
Re: label element containing input element
From: Neier, Garrett
Date: Jul 1, 2011 8:12AM
- Next message: Jared Smith: "Re: label element containing input element"
- Previous message: Jeevan Reddy: "Re: Skip to content links, what is the current best practice?"
- Next message in Thread: Jared Smith: "Re: label element containing input element"
- Previous message in Thread: None
- View all messages in this Thread
Hi All,
This issue was last discussed in 2003. The advice then was to separate the <label> from the form element.
Today, it appears that the technique of enclosing the form element in the <label> is more widely used and part of the spec.
Does anyone know if today's screen readers can handle it?
Example:
<label>
Enter text
<input type=text id=firstname>
</label>
http://www.w3.org/TR/html401/interact/forms.html#edef-LABEL
from
http://stackoverflow.com/questions/774054/should-i-put-input-tag-inside-label-tag
I ask because I would like to create the cleanest html, without resorting to <br> tags between elements.
The only example I found, without <br> tags, has <label> containing the element
http://www.themaninblue.com/experiment/InForm/margin.htm
thank you,
Gary
- Next message: Jared Smith: "Re: label element containing input element"
- Previous message: Jeevan Reddy: "Re: Skip to content links, what is the current best practice?"
- Next message in Thread: Jared Smith: "Re: label element containing input element"
- Previous message in Thread: None
- View all messages in this Thread