ClickStart logoHTML5 to the point

Specifying a placeholder value for a form element

You can use the placeholder attribute to include a sample value for a form element. Unlike an initial value, a placeholder value disappears when the element has focus, and it is not included if the user leaves the element blank.

Screenshot

Code

<input type="text" placeholder="Sample text">

<textarea placeholder="empty text"></textarea>

Example