Name

READONLY — NN n/a IE 4 HTML 4

Synopsis

READONLY

Optional

When the READONLY attribute is present, the text field INPUT element cannot be edited on the page by the user (although scripts can modify the content). A field marked as READONLY should not receive focus within the tabbing order (although IE 4 for the Macintosh allows the field to receive focus).

Input Types

password, text

Example

<INPUT TYPE="text" NAME="ZIP" READONLY>

Value

The presence of the attribute sets its value to true.

Default

false

Object Model Reference

IE

[window.]document.formName.inputName.readOnly

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

[window.]document.all.elementID.readOnly

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.