Name
HTMLInputElement — an input element in an HTML form
Availability
DOM Level 1 HTML
Inherits from/Overrides
Node → Element → HTMLElement → HTMLInputElement
Properties
-
String accept
A comma-separated list of MIME types that specify the types of files that may be uploaded when this is a FileUpload element. Mirrors the
accept
attribute.-
String accessKey
The keyboard shortcut (which must be a single character) that a browser may use to transfer keyboard focus to this input element. Mirrors the
accesskey
attribute.-
deprecated String align
The vertical alignment of this element with respect to the surrounding text, or the left or right float for the element. Mirrors the
align
attribute.-
String alt
Alternate text to be displayed by browsers that cannot render this input element. Particularly useful when
type
isimage
. Mirrors thealt
attribute.-
boolean checked
For Radio and Checkbox input elements, specifies whether the element is “checked” or not. Setting this property changes the visual appearance of the input element. Mirrors the
checked
attribute.-
boolean defaultChecked
For Radio and Checkbox elements, holds the initial value of the
checked
attribute as it appears in the document source. When the form is reset, thechecked
property is restored to the value of this property. Changing the value of this property changes the value of thechecked
property and the current checked state of the element.-
String defaultValue
For Text, Password, and FileUpload elements, holds the ...
Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.