W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2008

[whatwg] Placeholder option for text input boxes

From: Andy Lyttle <whatwg@phroggy.com>
Date: Tue, 30 Sep 2008 02:10:27 -0700
Message-ID: <4073B068-D717-41E7-A733-282D45045494@phroggy.com>
> 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.

You may find the behavior annoying, but hundreds if not thousands of  
popular sites are attempting to implement this behavior (via  
JavaScript and CSS) right now, and many of them are doing it badly.   
If it turns out to be just an annoying fad like <blink> was, then  
usage will fade away, for the same reason that we don't see much  
blinking text anymore even though "text-decoration: blink;" is still  
fully supported CSS.

-- 
Andy Lyttle
whatwg at phroggy.com
Received on Tuesday, 30 September 2008 02:10:27 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:05 UTC