Name

DISABLED — NN n/a IE 4 HTML 4

Synopsis

DISABLED

Optional

A disabled INPUT element appears grayed out on the screen and cannot be activated by the user. In Windows, a disabled form control cannot receive focus and does not become active within the tabbing order rotation. HTML 4.0 also specifies that the name/value pair of a disabled INPUT element should not be sent when the form is submitted. INPUT elements that normally perform submissions do not submit their form when disabled.

The DISABLED attribute is a Boolean type, which means that its presence in the attribute sets its value to true. Its value can also be adjusted after the fact by scripting (see the button object in Chapter 9).

Input Types

All.

Example

<BUTTON TYPE="submit" DISABLED>Ready to Submit </BUTTON>

Value

The presence of the attribute disables the element.

Default

false

Object Model Reference

IE

[window.]document.formName.inputName.disabled

[window.]document.forms[i].elements[i].disabled

[window.]document.all.elementID.disabled

Get Dynamic HTML: The Definitive Reference 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.