O'Reilly logo

HTML and XHTML Pocket Reference, 3rd Edition by Jennifer Robbins

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

Name

input — <input />

The input element is used to create a variety of form input controls. The type of control is defined by the type attribute. Following is a complete list of attributes (with descriptions) that can be used with the input element. Not all attributes can be used with all control types. The attributes associated with each control type are listed below.

Attributes

Core,Internationalization, Events, Focus ;plus onselect, onchange

alt="text"

Specifies alternative text for an image used as a button.

accept="MIME type"

Specifies a comma-separated list of content types that a server processing the form will handle correctly. It can be used to filter out nonconforming files when prompting a user to select files to send to the server.

accesskey="character"

Assigns an access key (keyboard shortcut) to an element for quicker access.

align="bottom|left|middle|right|top"

Deprecated. Specifies the alignment of an image.

checked="checked"

When this attribute is added, a checkbox will be checked by default.

disabled="disabled"

Disables the control for user input. It can be altered only via a script. Browsers may display disabled controls differently (grayed out, for example), which could be useful for dimming certain controls until required info is supplied.

ismap="ismap"

Indicates that the graphic is used as the basis for a server-side image map (an image containing multiple hypertext links). This attribute may be used with the “image” input type only.

maxlength="number"

Specifies the maximum ...

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