Html 5 Form Placeholder Attribute Tag

The placeholder attribute is used to give initial value for input type field. When you focus curser that placeholder initial value disappear from input field.

Syntax:

<input type="" placeholder="" />

Example Code



<!DOCTYPE HTML>
<form action="" method="post">
  Name:<input type="text" name="name" id="name" placeholder="Sample Text" />
  <input type="submit" value="Submit" />
</form>

Out Put :

In the above example put placeholder attribute for the Name input type.

ScreenShot :





Content