Input Time disabled Attribute
Example
Disable the time field:
document.getElementById("myTime").disabled = true;
The result could be:
Definition and Usage
The disabled attribute is used to set or return whether the time field is disabled.
Elements with the disabled attribute are unusable and unclickable. Disabled elements are typically displayed as grayed out in the browser.
This attribute reflects the HTML disabled attribute.
Browser Support
All major browsers support the disabled attribute.
Note: Internet Explorer or Firefox browsers do not support the HTML <input> element with the type="time" attribute.
Syntax
Return the disabled attribute:
Set the disabled attribute:
Attribute Values
| Value | Description | |
|---|---|---|
| true | false | Describes whether the time field is usable. true - The time field is unusable<br> false - Default. The time field is usable |
Technical Details
| Return Value: | Boolean, returns true if the time field is unusable, otherwise returns false | | --- | --- |
More Examples
Example
Check if the time field is usable:
var x = document.getElementById("myTime").disabled;
true
Example
Disable and enable the time field:
function disableBtn() { document.getElementById("myTime").disabled = true;
}
function undisableBtn() { document.getElementById("myTime").disabled = false;
}
Related Pages
HTML Reference: HTML <input> disabled Attribute