Cover by David Flanagan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Name

Input — an HTML <input> element

Inherits from

Node, Element, FormControl

Synopsis

An Input object represents an HTML form <input> element. Its appearance and behavior depends on its type attribute: an Input element might represent a simple text input field, a checkbox, a radio box, a button, or a file selection element, for example. Because an <input> element can represent so many kinds of form controls, the Input element is one of the most complicated. See HTML Forms for an overview of HTML forms and form elements. Note that some of the important properties of the Input element (such as type, value, name, and form) are documented in FormControl.

Properties

In addition to the properties listed here, Input elements also implement all of the properties defined by Element and FormControl. The properties marked with an asterisk in this list are newly defined by HTML5 and are not yet, at the time of this writing, widely implemented.

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 selected. The strings “audio/*”, “video/*”, and “image/*” are also legal. Mirrors the accept attribute.

string autocomplete

True if the browser can prefill this Input element with a value from a previous session. Mirrors that autocomplete attribute. See also the autocomplete property of Form.

boolean checked

For checkable input elements, this property specifies whether the element is “checked” or not. Setting this property changes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required