input placeholder Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:input

Description

The placeholder attribute specifies a short hint that describes the expected value of an input field.

The placeholder attribute works with the following input types: text, search, url, tel, email, and password.

Attribute Values

Value Description
text Specifies a short hint that describes the expected value of the input field

The following code shows how to add Two input fields with a placeholder text:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php">
  <input type="text" name="fname" placeholder="First name"><br>
  <input type="text" name="lname" placeholder="Last name"><br>
  <input type="submit" value="Submit">
</form><!--from  w  w w. j  av  a  2s.co m-->

</body>
</html>

Related Tutorials