SyntaxStudy
Sign Up

<input>

tag

Creates interactive controls in forms. Behavior changes drastically based on the type attribute.

Syntax

<input type="text" name="name" placeholder="Enter text" required>

Example

html
<!-- Text -->
<input type="text" placeholder="Your name">
<!-- Email -->
<input type="email" placeholder="email@example.com">
<!-- Password -->
<input type="password">
<!-- Number -->
<input type="number" min="1" max="100">
<!-- Checkbox -->
<input type="checkbox" id="agree"> <label for="agree">I agree</label>
<!-- Radio -->
<input type="radio" name="color" value="red"> Red
<!-- File -->
<input type="file" accept="image/*">
<!-- Date -->
<input type="date">