Latest web development tutorials

HTML DOM Textarea disabled property

Textarea Object Reference Textarea object

Examples

Example 1

Disable a text field:

<script>

document.getElementById("mytxt").disabled=true;

</script>

Output:


try it"


Definition and Usage

disabled property sets or returns whether you should disable the text box.

Disabled input elements are neither available, nor click. You can set the disabled property until meet certain other conditions are met (such as selecting a checkbox, etc.).

grammar

Set the disabled attribute:

element .disabled=true|false

Returns disabled properties:

element .disabled


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled attribute


Textarea Object Reference Textarea object