Input Week value property
Example
Set the year and week of the week field:
document.getElementById("myWeek").value = "2014-W48";
Try it »
Definition and Usage
The value property sets or returns the value attribute of the week field.
The value attribute 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 attribute
Note: Internet Explorer or Firefox browsers do not support .
Syntax
Return the value attribute:
weekObject
.value
Set the value attribute:
weekObject
.value=
YYYY-
W
WW
Attribute 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;
x
The output is:
1995-W35
Try it »
Related pages
HTML Reference Manual: HTML value attribute
The Input Week object