Latest web development tutorials

HTML DOM Input Week value property

Input Week Object Reference Input Week Objects

Examples

Setting week and weeks in the field:

. Document.getElementById ( "myWeek") value = "2014-W48";

try it"

Definition and Usage

value attribute is used to set the property value or return value week field.

value attribute describes the value entered by the user or a script or a default value entered value.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute value

Note: Internet Explorer or Firefox browser does not support <input type = "week"> element.


grammar

Returns the value property:

weekObject .value

Set the value property:

weekObject .value = YYYY- W WW

Property Value

value description
YYYY-W WW It describes the week and year. Interpreted as follows:
  • YYYY - year (eg: 2011)
  • "-W" Means "weeks"
  • WW - week (between 1-52 after 53 (depending on the year), such as: 01 for the first week of the year)
Examples: 2014-W15

technical details

return value: Years and Zhou string representing the week field


More examples

Examples

Get week in and week field

var x = document.getElementById ( "myWeek") value.;
x The output is:
1995-W35

try it"


Related Pages

HTML Reference Manual: HTML <the INPUT> value The property


Input Week Object Reference Input Week Objects