You are here: Reference > HTML > attributes > placeholder (input, isindex)

placeholder attribute (input, isindex)

Browser support:
Sets the initial value of the text field.
Different from the value attribute. The placeholder attribute only displays an initial value for the control. The initial value is not the value of the control, it is only a text that is displayed initially in the element. When the control gets the focus, the initial value disappears.
JavaScript page for this attribute: placeholder. You can find other example(s) there.

Possible values:

String that sets the initial value.
Default: this attribute has no default value.

Example HTML code 1:

This example illustrates the use of the placeholder attribute:
<input type="text" placeholder="Please fill this field" />
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content