input text field placeholders(gray text)
The placeholder attribute to give the user a helpful hint. When you use the button element to reset the form, the browser restores the placeholders values.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<form method="post" action="http://yourServer/form">
<p>
<label for="name"> Name:
<input placeholder="Your name" id="name" name="name" />
</label>
</p>
<p>
<label for="city"> City:
<input placeholder="Where you live" id="city" name="city" />
</label>
</p>
<p>
<label for="fave"> Survey:
<input value="YourInput" id="fave" name="fave" />
</label>
</p>
<button type="submit">Submit Vote</button>
</form>
</body>
</html>
Home
HTML CSS Book
HTML
HTML CSS Book
HTML
input:
- <input> element
- input element max size
- input text field size
- input text field initial value
- input text field placeholders(gray text)
- Using a Data List
- Read-Only input text field
- Disabled Text Boxes
- input element for password input
- Using the input Element to Create Buttons
Related: