Interview Question

What is a placeholder attribute?

Placeholder is a hint, not a replacement for a label.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

The `placeholder` attribute shows a short hint inside an empty form field. β€’ It is written inside an element’s opening tag. β€’ The HTML Standard limits which elements may use it and which values are valid. β€’ Browsers apply the attribute when they process the element or the resource it controls.

💡 Simple Example

<input placeholder="Enter your name">

⚡ Quick Revision

Placeholder is a hint, not a replacement for a label.