YouTip LogoYouTip

Dom Obj Datetime Local

# HTML DOM Input DatetimeLocal Object * * * ## Input DatetimeLocal Object The Input DatetimeLocal object is new in HTML5. The Input DatetimeLocal object represents an HTML `` element with `type="datetime-local"`. **Note:** Internet Explorer or Firefox browsers do not support the `` element. ### Accessing an Input DatetimeLocal Object You can use the `getElementById()` function to access an `` element with the `type="datetime-local"` attribute: ```javascript var x = document.getElementById("myLocalDate"); (#) **Tip:** You can also access the Input DatetimeLocal object through the form's (#) collection. ### Creating an Input DatetimeLocal Object You can use the `document.createElement()` method to create an `` element with the `type="datetime-local"` attribute: ```javascript var x = document.createElement("INPUT"); x.setAttribute("type", "datetime-local"); (#) ## Input DatetimeLocal Object Properties | Property | Description | | --- | --- | | autocomplete | Sets or returns the autocomplete attribute value of the local time field | | (#) | Sets or returns whether the local time field should automatically get focus when the page loads | | defaultValue | Sets or returns the default value of the local time field | | (#) | Sets or returns whether the local time field is disabled | | (#) | Returns a reference to the form that contains the local time field | | list | Returns a reference to the datalist that contains the local time field | | max | Sets or returns the max attribute value of the local time field | | min | Sets or returns the min attribute value of the local time field | | (#) | Sets or returns the name attribute value of the local time field | | (#) | Sets or returns whether the local time field is read-only | | (#) | Sets or returns whether the local time field must be filled out before submitting a form | | step | Sets or returns the step attribute value of the local time field | | (#) | Returns the form element type of the local time field | | (#) | Sets or returns the value attribute value of the local time field | ## Standard Properties and Events The Input DatetimeLocal object also supports standard (#) and (#). * *
← Prop Datetime Local AutofocusProp Datetime Value β†’