Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML DOM Input DatetimeLocal object


May 06, 2021 JavaScript with HTML DOM Reference book


Table of contents


HTML DOM Input DatetimeLocal object


Input DatetimeLocal object

The Input DatetimeLocal object is new to HTML5.

The Input DatetimeLocal object represents an HTML-lt;input-gt; element that uses type"datetime-local".

Note: Internet Explorer or Firefox browsers do not support the element.

Access the Input DatetimeLocal object

You can use the getElementById() function to access the elements that use the type"datetime-local" property:

var x = document.getElementById("myLocalDate"); try it

Tip: You can also access the Input DatetimeLocal object through the form's collection of elements.

Create an Input DatetimeLocal object

You can use the document.createElement() method to create an element that uses the type"datetime-local" property:

var x = document.createElement("INPUT");
x.setAttribute("type", "datetime-local"); try it

Input DatetimeLocal object properties

Attributes describe
autocomplete Set or return the autocomplete attribute value of the local time field
autofocus Set or return local time fields to automatically get focus after the page is loaded
defaultValue Set or return to the default value for local time fields
disabled Set or return local time fields available
form Returns a form reference to using the local time field
list Returns a DataList reference that contains local time fields
max Set or return the max attribute value of the local time field
min Set or return the min attribute value of the local time field
name Set or return Name property values for local time fields
readOnly Set or return to the local time field read only
required Set or return local time fields to be required in the form
step Set or return to the STEP attribute value of the local time field
type Returns the type element type of the local time field
value Set or return the value attribute value of the local time field

Standard properties and events

The Input DatetimeLocal object also supports standard properties and events.


Related articles

HTML tutorial: HTML forms

HTML Reference Manual: HTML slt;input.gt; Tags

HTML Reference Manual: HTML slt;input> type property