HTML DOM Input Datetime readOnly property
Examples
Datetime field is set to read-only:
. Document.getElementById ( "myDatetime") readOnly = true;
Output:
try it"
Definition and Usage
readOnly property sets or returns datetime 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
All major browsers support readOnly property.
Note: Internet Explorer, Firefox, Opera 15 ( and higher) or Chrome supports the <input> element using type = "datetime".
grammar
Back readOnly attributes:
datetimeObject .readOnly
Set readOnly properties:
datetimeObject .readOnly = true | false
Property Value
value | description |
---|---|
true | false | Describes a datetime field is read-only
|
technical details
return value: | Boolean value that, if the datetime field is read-only returns true, otherwise returns false. |
---|
More examples
Examples
See datetime field is read-only:
var x = document.getElementById ( "myDatetime") readOnly.;
x The output is: true
try it"
related articles
HTML Reference Manual: HTML <the INPUT> Readonly property
Input Datetime Object