type

The type attribute defines the kind of an input control, button behavior, script language, or list marker.

Since HTML 2.0 Spec ↗

Syntax

type="value"

Examples

<input type="email">
<input type="number" min="0">
<button type="submit">Go</button>
<script type="module" src="/m.js"></script>
Output
Renders an email field, a numeric spinner, a submit button, and loads an ES module.

Notes

For <input>, type drives keyboard, validation, and UI (text, email, password, number, date, color, file, checkbox, radio, range). For <button>, the default inside a form is submit. For <script>, type="module" enables ES modules.

Browser & runtime support

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12

See also