Set a date and time for a datetime field:
The value property sets or returns the value of the value attribute of a datetime field.
The value attribute specifies a date and time for the datetime field.
The value property is supported in all major browsers.
Note: The <input type="datetime"> element is not supported in Internet Explorer, Firefox, Opera version 15 (and newer) or Chrome.
Return the value property:
Set the value property:
Value | Description |
---|---|
YYYY-MM-DDThh:mm:ssTZD |
Specifies the date and/or time. Explanation of components:
|
Return Value: | A String, representing the date and time of the datetime field |
---|
Get the date and time of a datetime field:
The result of x will be:
HTML reference: HTML <input> value attribute