Latest web development tutorials

HTML DOM Password disabled property

Password Object Reference Password objects

Examples

Example 1

Disable the password field:

<script>

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

</script>

Output:


try it"


Definition and Usage

disabled property sets or returns whether to disable the password field.

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 disabled property


Password Object Reference Password objects