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 −

AttributesDescription
autocompleteIt defines the value of autocomplete attribute of a datetimeLocal field
autofocusIt defines if the datetimeLocal field should be focused on initial page load.
defaultValueIt sets/returns the default value of datetimeLocal field
disabledIt defines if datetimeLocal field is disabled/enabled
formIt returns a reference of enclosing form that contains the datetimeLocal field
maxIt returns/sets the value of max attribute of datetimeLocal field
minIt returns/sets the value of min attribute of datetimeLocal field
nameIt defines the value of name attribute of a datetimeLocal field
readOnlyIt defines if the datetimeLocal field is read only or not
requiredIt defines if the datetimeLocal field is compulsory to be filled in order to submit the form
stepIt defines the value of the step attribute of datetimeLocal field
typeIt returns the type of form element of datetimeLocal field
valueIt defines the value of the value attribute of a datetimeLocal field

Boolean Values

And, also the following methods −

booleanValueDetails
stepDownIt defines the amount of minutes the datetimeLocal field should decrease.
stepUpIt defines the amount of minutes the datetimeLocal field should increase.

Updated on: 30-Jul-2019

51 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements