Latest web development tutorials

HTML DOM Input DatetimeLocal readOnly property

Input DatetimeLocal Object Reference Input DatetimeLocal objects

Examples

Set the local time field is read-only:

. Document.getElementById ( "myLocalDate") readOnly = true;

Output:


try it"

Definition and Usage

readOnly property sets or returns the local time field is read-only.

Read-only fields can not be modified. But you can copy the contents of the field.

This property reflects the HTML readonly attribute.

Tip: To ensure the accuracy of the form data, you can use the disabled property instead.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The readOnly property in all major browsers support

Note: Internet Explorer or Firefox browser does not support <input type = "datetime-local "> element.


grammar

Back readOnly attributes:

datetimelocalObject .readOnly

Set readOnly properties:

datetimelocalObject .readOnly = true | false

Property Value

value description
true | false Describes the local time field is read-only
  • true - the local time is read-only field
  • false - default. Local time, not read-only field

technical details

return value: Boolean value that, if the local time is read-only field returns true, otherwise returns false.


More examples

Examples

Check local time field is read-only:

var x = document.getElementById ( "myLocalDate") readOnly.;
x The output is:
true

try it"


Related Pages

HTML Reference Manual: HTML <the INPUT> Readonly property


Input DatetimeLocal Object Reference Input DatetimeLocal objects