HTML DOM Input DatetimeLocal disabled property
Examples
Disable the local time field:
. Document.getElementById ( "myLocalDate") disabled = true;
Results output:
try it"
Definition and Usage
disabled property sets or returns whether the local time field is disabled.
Use the disabled attribute elements are not available and can not be clicked. Disabled elements are usually displayed on the browser gray.
Property reflects the HTML disabled property.
Browser Support
All major browsers support the disabled attribute.
Note: Internet Explorer or Firefox browser does not support <input type = "datetime-local "> element.
grammar
Returns disabled properties:
datetimelocalObject .disabled
Set the disabled attribute:
datetimelocalObject .disabled = true | false
Property Value
value | description |
---|---|
true | false | Description Local time fields are available.
|
technical details
return value: | Boolean value, if the field is unavailable local time returns true, false otherwise |
---|
More examples
Examples
Check local time fields are available:
var x = document.getElementById ( "myLocalDate") disabled.;
x The output is: true
try it"
Examples
Disable or enable the local time field:
function disableBtn () {
. Document.getElementById ( "myLocalDate") disabled = true;
}
function undisableBtn () {
. Document.getElementById ( "myLocalDate") disabled = false;
}
. Document.getElementById ( "myLocalDate") disabled = true;
}
function undisableBtn () {
. Document.getElementById ( "myLocalDate") disabled = false;
}
try it"
Related Pages
HTML Reference Manual: HTML <the INPUT> Disabled Property
Input DatetimeLocal objects