YouTip LogoYouTip

Dom Obj Date

# HTML DOM Input Date Object * * * ## Input Date Object The Input Date Object is new in HTML5. The Input Date Object represents an HTML `` element with the `type="date"` attribute. **Note:** IE11 and earlier versions do not support `` elements with the `type="date"` attribute. ### Accessing the Input Date Object You can access an `` element with `type="date"` by using the `getElementById()` function: ```javascript var x = document.getElementById("myDate"); (#) **Tip:** You can also access the Input Date object through the form's (#) collection. ### Creating an Input Date Object You can create an `` element with `type="date"` by using the `document.createElement()` method: ```javascript var x = document.createElement("INPUT"); x.setAttribute("type", "date"); (#) ## Input Date Object Properties | Property | Description | | --- | --- | | autocomplete | Sets or returns the autocomplete attribute value of the date field | | (#) | Sets or returns whether the date field should automatically get focus when the page loads | | defaultValue | Sets or returns the default value of the date field | | (#) | Sets or returns whether the date field is disabled | | (#) | Returns a reference to the form that contains the date field | | list | Returns a reference to the datalist that contains the date field | | max | Sets or returns the max attribute value of the date field | | min | Sets or returns the min attribute value of the date field | | (#) | Sets or returns the name attribute value of the date field | | (#) | Sets or returns whether the date field is read-only | | (#) | Sets or returns whether the date field must be filled out before submitting the form | | step | Sets or returns the step attribute value of the date field | | (#) | Returns the form type of the date field | | (#) | Sets or returns the value attribute value of the date field | ## Standard Properties and Events The Input Date Object also supports standard (#) and (#). * * * ## Related Articles HTML Tutorial: (#) HTML Reference: [HTML `` Tag](#) HTML Reference: [HTML `` type Attribute](#) [](#)(
← Prop Date AutofocusProp Color Value β†’