HTML DOM Input DatetimeLocal Object



The HTML DOM Input DatetimeLocal Object represents an input HTML element with type datetimeLocal.

Syntax

Following is the syntax −

  • Creating an <input> with type datetimeLocal
var datetimeLocalObject = document.createElement(“input”);
datetimeLocalObject.type = “datetime-local”;

Attributes

Here, “datetimeLocalObject” can have the following attributes −

Attributes Description
autocomplete It defines the value of autocomplete attribute of a datetimeLocal field
autofocus It defines if the datetimeLocal field should be focused on initial page load.
defaultValue It sets/returns the default value of datetimeLocal field
disabled It defines if datetimeLocal field is disabled/enabled
form It returns a reference of enclosing form that contains the datetimeLocal field
max It returns/sets the value of max attribute of datetimeLocal field
min It returns/sets the value of min attribute of datetimeLocal field
name It defines the value of name attribute of a datetimeLocal field
readOnly It defines if the datetimeLocal field is read only or not
required It defines if the datetimeLocal field is compulsory to be filled in order to submit the form
step It defines the value of the step attribute of datetimeLocal field
type It returns the type of form element of datetimeLocal field
value It defines the value of the value attribute of a datetimeLocal field

Boolean Values

And, also the following methods −

booleanValue Details
stepDown It defines the amount of minutes the datetimeLocal field should decrease.
stepUp It defines the amount of minutes the datetimeLocal field should increase.
Updated on: 2019-07-30T22:30:26+05:30

87 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements