<input>

HTML4 HTML5

Used to create interactive controls in forms to accept user input. Appearance and functionality depend on the type attribute.

Void element with no closing tag.

Attributes:

Example

Code:

<div style="display: flex; flex-direction: column; gap: 10px; max-width: 300px;"> <input type="text" placeholder="Text field (text)" style="padding: 8px; border: 1px solid #ccc; border-radius: 4px;"> <input type="password" placeholder="Password (password)" style="padding: 8px; border: 1px solid #ccc; border-radius: 4px;"> <label style="display: flex; align-items: center; gap: 8px;"> <input type="checkbox" checked> Checkbox (checkbox) </label> </div>

The browser will interpret this code as follows: