- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Tue, 30 Sep 2008 09:00:03 -0500
On Tue, Sep 30, 2008 at 4:10 AM, Andy Lyttle <whatwg at phroggy.com> wrote: > I do not like this idea at all. That is what LABEL is for, and >> disappearing >> "it's so kewl" text is as annoying as BLINK and BGSOUND. >> Chris >> > > The <label> tag is great for labels that are displayed outside the input > box (in front of, above, etc.). The placeholder attribute is intended more > as a hint than a label, and is displayed inside the input box without taking > up any additional space on the page. An example might be: > > <label for="where">Get local weather forecast:</label> > <input type="search" name="where" id="where" placeholder="City, State"> > > Using the "alt" attribute has been suggested here, but no implementation > uses "alt" in this way, while "placeholder" is already supported by one > major browser (and since it really isn't alternate text, using "alt" doesn't > make any sense). Another suggestion was to use the "title" attribute, which > is a better idea, but "title" is generally implemented as a tooltip that > doesn't appear until you hover over the element, which is not the desired > behavior. It's perfectly legitimate to use a <label> tag AND title AND > placeholder attributes, for three subtly different purposes. Hm. I have a problem with your example. "Get local weather forecast" isn't a semantic <label> for the field - it doesn't describe what the field is for. It describes what the *form* is for, and so should be a <legend> or <hn>. "City, State" actually describes the use of the <input> itself, and should be the label. I'd suspect that *all* examples where placeholder text is used (definitely all the examples I know of personally) are most semantically served by a <label> with the text. Iirc, I once saw a nice javascript solution that mutated the DOM to remove the <label> and use its text as a placeholder. Thus, I think this is best served by a CSS directive that does exactly that. External vs placeholder text is a display issue - semantically, both are labels for the field. The only question would be whether to make this a property of <label> or <input>... Probably <label> - targetting <input> would result in action-at-a-distance. ~TJ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080930/9e25c6f8/attachment.htm>
Received on Tuesday, 30 September 2008 07:00:03 UTC