Password disabledProperty

Password 对象参考手册Password Object

Examples

Example 1

Disable password field:

<script>

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

</script>

Output:


Try it yourself »


Definition and Usage

The disabled property sets or returns whether the password field is disabled.

Disabled input elements are neither usable nor clickable. The disabled attribute can be set until some other condition is met (e.g., a checkbox is selected, etc.).

Syntax

Set the disabled property:

element.disabled=true|false

Return the disabled property:

element.disabled


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled property.


Password 对象参考手册Password Object Other Extensions