Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Week Object

HTML DOM Input Week Object


The Input Week object

The Input Week object is new in HTML5.

The Input Week object represents an HTML element that uses the type="week" attribute .

**Note:** The Internet Explorer or Firefox browser does not support the HTML element that uses the type="week" attribute .

Access the Input Week Object

You can use the getElementById() function to access the element that uses the type="week" attribute element:

var x = document.getElementById("myWeek");

Try it

Tip: You can also access the Input Color object through a form'sElementcollection to access the Input Week object.

Create the Input Week Object

You can use the document.createElement() method to create the element that uses the type="week" attribute element:

var x = document.createElement("INPUT");

x.setAttribute("type", "week");

Try it

Input Week Object Properties

property Description
autocomplete Sets or returns the value of the autocomplete attribute of the week field
autofocus Sets or returns whether the week field automatically gets focus after the page loads
defaultValue Sets or returns the default value of the week field
disabled Sets or returns whether the week field is enabled
form Returns a reference to the form that uses the week field
list Returns a reference to the datalist that contains the week field
max Sets or returns the value of the max attribute of the week field
min Sets or returns the value of the min attribute of the week field
name Sets or returns the value of the name attribute of the week field
readOnly Sets or returns whether the week field is read-only
required Sets or returns whether the week field is required in the form
step Sets or returns the value of the step attribute of the week field
type Returns the form element type of the week field
value Sets or returns the value of the value attribute of the week field

Standard properties and events

The Input Week object also supports standard property and Events.


Related Articles

HTML Tutorial: HTML Forms

HTML Reference Manual: HTML tag

HTML Reference Manual: HTML type Attribute