Latest web development tutorials

HTML DOM Input Datetime disabled property

Input Datetime Object Reference Input Datetime Object

Examples

Disable datetime fields:

. Document.getElementById ( "myDatetime") disabled = true;

Results output:


try it"

Definition and Usage

disabled property sets or returns datetime fields are disabled.

Use the disabled attribute elements are not available and can not be clicked. Disabled elements are usually displayed on the browser gray.

This property reflects the HTML disabled property.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the disabled attribute.

Note: Internet Explorer, Firefox, Opera 15 ( and higher) or Chrome supports the <input> element using type = "datetime".


grammar

Returns disabled properties:

datetimeObject .disabled

Set the disabled attribute:

datetimeObject .disabled = true | false

Property Value

value description
true | false Description datetime field is available.
  • true - datetime field is unavailable
  • false - default. datetime field is available

technical details

return value: Boolean value that is not available if the datetime field returns true, false otherwise


More examples

Examples

See datetime fields are available:

var x = document.getElementById ( "myDatetime") disabled.;
x The output is:
true

try it"

Examples

Disable and enable datetime fields:

function disableBtn () {
. Document.getElementById ( "myDatetime") disabled = true;
}
function undisableBtn () {
. Document.getElementById ( "myDatetime") disabled = false;
}

try it"


Related Pages

HTML Reference Manual: HTML <the INPUT> Disabled Property


Input Datetime Object Reference Input Datetime Object