HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Input Date Object : Set a date field to read-only
The readOnly property sets or returns whether a date field should be read-only, or not.
A read-only field cannot be modified. However, a user can tab to it, highlight it, and copy the text from it.
This property reflects the HTML readonly attribute.
Property | |||||
---|---|---|---|---|---|
readOnly | Yes | 12.0 | Yes | Yes | Yes |
Return the readOnly property:
Set the readOnly property:
Value | Description |
---|---|
true|false |
Specifies whether a date field should be read-only, or not
|
Return Value: | A Boolean, returns true if the date field is read-only, otherwise it returns false |
---|
Find out if a date field is read-only or not:
var x = document.getElementById("myDate").readOnly;
HTML reference: HTML <input> readonly attribute
❮ Input Date Object