Input Button disabledProperty

Input Button 对象参考手册Input Button Object

Examples

Example 1

Disable a button:

<script>

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

</script>

Output result:


Try it Yourself »


Definition and Usage

The disabled property sets or returns whether a button is available.

Disabled elements are unusable, i.e., cannot be clicked. Disabled elements are usually displayed in gray in browsers.

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


Input Button 对象参考手册Input Button Object Other Extensions