Advertisement
Home Open Editor ❯

HTML <input> placeholder Attribute

Example

<input type="text" id="fname" name="fname" placeholder="First Name">

Try this code ❯

Meaning

The placeholder attribute specifies a short bit of text that is used to help the user figure out what type of information to fill in for a form control.

The text will be placed in the field and cleared on entering.


Standard Syntax

HTML: <input placeholder="text">

XHTML: <input placeholder="text"/>

Browser Support

Note:


Status


Advertisement

Attribute Values

Value Description
text Specifies a text that specify the expected value of the input field be.
Home Open Editor ❯
Advertisement