Name

Input: an input element in an HTML form — DOM Level 2 HTML: Node → Element → HTMLElement → Input

Properties

String accept

When type is “file”, this property is a comma-separated list of MIME types that specify the types of files that may be uploaded. Mirrors the accept attribute.

String accessKey

The keyboard shortcut (which must be a single character) a browser can 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 is “image”. Mirrors the alt attribute.

boolean checked

When type is “radio” or “checkbox”, this property 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

When type is “radio” or “checkbox”, this property holds the initial value of the checked attribute as it appears in the document source. When the form is reset, the checked property is restored to the value of this property. Changing the value of this property changes the value of the checked property and the current checked state of the element.

String defaultValue

When type is “text”, “password”, or “file”, this ...

Get JavaScript: The Definitive Guide, 5th 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.