[whatwg] Placeholder option for text input boxes
dhtmlkitchen at gmail.com
Mon Sep 29 22:54:31 PDT 2008
On Mon, Sep 29, 2008 at 5:20 PM, Andy Lyttle <whatwg at phroggy.com> wrote:
> Hi all!
> I would like to see Apple's <input type="search"> adopted as an official
> standard, but there's one particular feature that would be easy to adopt
> without supporting the rest, and that's the "placeholder" option.
> Currently, lots of sites are implementing placeholder text through a
> reinvent the wheel, and very often the wheel gets reinvented badly (examples
> below). Making it a standard feature of HTML would eliminate the need for
> all the extra scripting and improve accessibility, and consistent behavior
> would make a better user experience.
> The desired behavior is for the placeholder text to appear in the field with
> a gray color when the field is not focused and the value is empty. Of
> course the meaning of "gray" is up to the browser. The placeholder option
> was originally intended for search fields, but it's useful for other input
> types as well, and Safari already supports it on all text input fields. The
> HTML simply looks like:
> <input name="zip" placeholder="Zip Code">
> tricks in an attempt to simulate this behavior, to varying degrees of
> These use black placeholder text that disappears on focus but does not
> reappear on blur:
> As you can see, that's seven different behaviors, some of which are clearly
> implement, test in multiple browsers, and debug. Supporting the placeholder
> attribute (which is already implemented in one major browser) would solve
> all of these problems.
|placeholder| sounds a little like |alt|. Alt is a property and an
attribute on INPUT.
How to specify alternate text:
> Andy Lyttle
> whatwg at phroggy.com
More information about the whatwg