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

[whatwg] Placeholder option for text input boxes

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Tue, 28 Oct 2008 21:16:02 +0100
Message-ID: <49077302.9040601@lachy.id.au>
Tab Atkins Jr. wrote:
> 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.

I found real example that uses both a label and placeholder text.  In 
the iPhone, the dialog for setting up a new e-mail account, contains 
four fields, each with a label and an example provided as placeholder 
text. These are:

[Label]      [Placeholder]
Name:        John Appleseed
Address:     example at me.com
Password:    Required
Description: My Email Account

Lachlan Hunt - Opera Software
Received on Tuesday, 28 October 2008 13:16:02 UTC

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