Input Submit disabled attribute

Definition and Usage

disabled Set or return whether the submit button should be disabled.

Disabled elements are not available and cannot be clicked. By default, disabled elements are usually displayed in gray in the browser.

See also:

HTML Reference Manual:HTML <input> disabled Attribute

Example

Example 1

Disable the submit button:

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

Try it yourself

Example 2

Check if the submit button is disabled:

var x = document.getElementById("mySubmit").disabled;

Try it yourself

Syntax

Return the disabled attribute:

submitObject.disabled

Set the disabled attribute:

submitObject.disabled = true|false

Attribute Value

Value Description
true|false

Specifies whether the submit button should be disabled

  • true - The submit button is disabled
  • false - Default. The submit button is not disabled

Technical Details

Return value: Boolean value, returned if the submit button is disabled true; otherwise return false.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support