Input Week valueProperties
Examples
Set the year and week of the week field:
document.getElementById("myWeek").value = "2014-W48";
Try it yourself »
Definition and Usage
The value property sets or returns the value of the value attribute of the week field.
The value property describes the value entered by the user, the default value, or the value entered by a script.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the value property.
Note:Internet Explorer or Firefox browsers do not support the <input type="week"> element.
Syntax
Return the value property:
weekObject.value
Set the value property:
weekObject.value=YYYY-WWW
Property Values
| Value | Description |
|---|---|
| YYYY-WWW | Describes the week and year. Parsed as follows:
|
Technical Details
| Return Value: | A string representing the year and week of the week field. |
|---|
More Examples
Example
Get the year and week of the week field
var x = document.getElementById("myWeek").value;
xThe output result is:1995-W35
Try it yourself »
Related Pages
HTML Reference Manual:HTML <input> value Attribute
Input Week Object Other Extensions