HTML CSS examples for HTML Tag:input
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.
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:
<!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>