HTML placeholder Attribute (original) (raw)
Last Updated : 25 May, 2026
The HTML placeholder attribute provides a short hint or example inside an input field before the user enters a value. It helps users understand the expected type of input.
- Displays hint text inside input or textarea fields.
- Disappears when the user starts typing.
- Improves form usability and user guidance.
- Commonly used with text, email, password, and search fields.
**Syntax:
HTML placeholder Attribute Examples
**Example 1: HTML placeholder attribute specifies a short hint or example text displayed in an input field before the user enters a value. It helps users understand the expected input format or content.
HTML `
HTML placeholder Attribute Example
Enter your first name:Enter your last name:
`
**Example 2: HTML is used to specify the expected value to be displayed before user input in textarea element.
HTML `
HTML placeholder Attribute Example
`