HTMLInputElement
The interface for <input>. Extends HTMLElement → Element.
Reflected properties
All setters are guarded and throw NoModificationAllowedError on a read-only document.
| Property | Attribute | Type | Notes |
|---|---|---|---|
type |
type |
enum | Keywords: text · search · tel · url · email · password · date · month · week · time · datetime-local · number · range · color · checkbox · radio · file · submit · image · reset · button · hidden. Missing → "text"; invalid → "text". |
name |
name |
string | Reflects the content attribute verbatim. |
value |
value |
string | Reflects the content attribute (the browser's defaultValue) — not live editing state, since the server DOM is static. |
placeholder |
placeholder |
string | Reflects the content attribute verbatim. |
required |
required |
boolean (presence) | Reading reflects whether the attribute is present; writing false removes it, any other value sets it present. |
disabled |
disabled |
boolean (presence) | Reading reflects whether the attribute is present; writing false removes it, any other value sets it present. |
readOnly |
readonly |
boolean (presence) | Reading reflects whether the attribute is present; writing false removes it, any other value sets it present. |
checked |
checked |
boolean (presence) | Reading reflects whether the attribute is present; writing false removes it, any other value sets it present. |
min |
min |
string | Reflects the content attribute verbatim. |
max |
max |
string | Reflects the content attribute verbatim. |
step |
step |
string | Reflects the content attribute verbatim. |
pattern |
pattern |
string | Reflects the content attribute verbatim. |
autocomplete |
autocomplete |
string | Reflects the content attribute verbatim. |
See also
- Element —
getAttribute/setAttribute, content,classList, traversal, insertion - HTMLElement — the global reflected properties every HTML element inherits
- JavaScript DOM API — the interface hierarchy and
instanceof