placeholder attribute (input, isindex)
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.
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:
Did you find this example helpful?
Supported by tags:
User Contributed Comments