Latest web development tutorials

HTML DOM Input Button disabled property

Input Button Object Reference Input Button objects

Examples

Example 1

Disable a button:

<script>

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

</script>

Output:


try it"


Definition and Usage

disabled property sets or return button is available.

disabled element is not available, that is not clickable. Disabling elements in the browser typically rendered in gray.

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


Input Button Object Reference Input Button objects