Easy Tutorial
❮ Prop Audio Played Event Onplay ❯

HTML DOM Input DatetimeLocal Object


Input DatetimeLocal Object

The Input DatetimeLocal object represents an HTML <input> element with type="datetime-local".

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

Accessing the Input DatetimeLocal Object

You can access an <input> element with type="datetime-local" using the getElementById() function:

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

Creating the Input DatetimeLocal Object

You can create an <input> element with type="datetime-local" using the document.createElement() method:

Input DatetimeLocal Object Properties

Property Description
autocomplete Sets or returns the autocomplete attribute value of the datetime-local field
autofocus Sets or returns whether the datetime-local field should automatically get focus when the page loads
defaultValue Sets or returns the default value of the datetime-local field
disabled Sets or returns whether the datetime-local field is enabled or disabled
form Returns a reference to the form that contains the datetime-local field
list Returns a reference to the datalist that contains the datetime-local field
max Sets or returns the max attribute value of the datetime-local field
min Sets or returns the min attribute value of the datetime-local field
name Sets or returns the name attribute value of the datetime-local field
readOnly Sets or returns whether the datetime-local field is read-only
required Sets or returns whether the datetime-local field is required in the form
step Sets or returns the step attribute value of the datetime-local field
type Returns the type of the form element for the datetime-local field
value Sets or returns the value attribute value of the datetime-local field

Standard Attributes and Events

The Input DatetimeLocal object also supports standard attributes and events.


Related Articles

HTML Tutorial: HTML Forms

HTML Reference: HTML <input> Tag

HTML Reference: HTML <input> type Attribute

❮ Prop Audio Played Event Onplay ❯