placeholder

Jump to: navigation, search

placeholder

This page has been flagged with the following issues:

High-level issues:


W3C Candidate Recommendation

Summary

The placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format).


Applies to HTMLInputElement

The short hint is displayed in the input field before the user enters a value.

Examples

HTML

Address: <input type="text" name="address" placeholder="Insert here your address" />
Date of birth: <input type="text" name="day" placeholder="DD" />
<input type="text" name="month" placeholder="MM" />
<input type="text" name="year" placeholder="YYYY" />

Notes

Remarks

The placeholder attribute can be used on text or text area input controls, or with text-based input attributes URL or email. The following example shows the placeholder text on a URL input field.

Syntax

Standards information

Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic Support 22
15
10
12.1
5.1

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic Support 2.1
7.0
?
?
10
?
?
3.2

See also

Related pages (MSDN)

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]