Input Date valueProperty
Example
Set the date of the date field:
document.getElementById("myDate").value = "2014-02-09";
Try it yourself »
Definition and Usage
The value property sets or returns the value of the value attribute of the date field.
The value property describes the date of the date field.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the value property
Note:Internet Explorer or Firefox browsers do not support the <input type="date"> element.
Syntax
Return the value property:
inputdateObject.value
Set the value property:
inputdateObject.value=YYYY-MM-DD
Property Values
| Value | Description |
|---|---|
| YYYY-MM-DD | Specifies the date of the date field. Explanation:
|
Technical Details
| Return value: | A string, representing the date of the date field. |
|---|
More Examples
Example
Get the date of the date field:
var x =
document.getElementById("myDate").value;
xThe output result is:2000-05-05
Try it yourself »
Related Pages
HTML Reference Manual:HTML <input> value Attribute
Input Date Object Other Extensions