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 属性
Example
Example 1
Disable the submit button:
document.getElementById("mySubmit").disabled = true;
Example 2
Check if the submit button is disabled:
var x = document.getElementById("mySubmit").disabled;
Syntax
Return disabled attribute:
submitObject.disabled
Set disabled attribute:
submitObject.disabled = true|false
属性值
值 | 描述 |
---|---|
true|false |
规定是否应禁用提交按钮。
|
技术细节
返回值: | 布尔值,如果提交按钮被禁用,则返回 true ;否则返回 false 。 |
---|
浏览器支持
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
支持 | 支持 | 支持 | 支持 | 支持 |