Interview Question

Different types of input fields?

Choose the input type that matches the data, then provide a clear label.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

The `<input>` `type` attribute selects the kind of data field and its browser behavior. • Common types include `text`, `email`, `password`, `number`, `date`, `checkbox`, `radio`, and `file`. • The browser may provide a suitable keyboard, picker, validation, or control for the chosen type. • Every user-facing input needs an accessible label.

💡 Simple Example

<label for="email-address">Email</label><input id="email-address" name="email" type="email" autocomplete="email" required>

⚡ Quick Revision

Choose the input type that matches the data, then provide a clear label.