Input Date value attribute
Example
Set the date of the date field:
document.getElementById("myDate").value = "2014-02-09";
Try it »
Definition and Usage
The value attribute is used to set or return the value of the date field's value attribute.
The value attribute describes the date of the date field.
Browser support





All major browsers support the value attribute
**Note:** Internet Explorer or Firefox browser does not support .
Syntax
Return the value attribute:
inputdateObject
.value
Set the value attribute:
inputdateObject
.value=
YYYY-MM-DD
Attribute values
| Value | Description |
|---|---|
| YYYY-MM-DD | Specify the date of the date field. |
说明:
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;
x
The output is:
2000-05-05
Try it »
Related pages
HTML Reference Manual: HTML value attribute
Input Date Object