[whatwg] Placeholder option for text input boxes

Andy Lyttle whatwg at phroggy.com
Tue Sep 30 02:10:27 PDT 2008


> 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




More information about the whatwg mailing list