WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML DOM Input Date Object


Input Date Object

The Input Date Object is new in HTML5.

The Input Date object speaks to a HTML <input> component with type="date".

Note: <input> components with type="date" are not upheld in Web Explorer or Firefox.

Access an Input Date Object

You can get to a <input> component with type="date" by utilizing getElementById():

var x = document.getElementById("myDate"); Try it

Tip: You can likewise get to <input type="date"> via seeking through the elements accumulation of a form.

Create an Input Date Object

You can make a <input> component with type="date" by utilizing the document.createElement() method:

var x = document.createElement("INPUT");
x.setAttribute("type", "date");

Input Date Object Properties

Property Description
autocomplete Sets or returns the estimation of the autocomplete property of a date field
autofocus Sets or returns whether a date field ought to consequently get center at the point when the page loads
defaultValue Sets or returns the default estimation of a date field
disabled Sets or returns whether a date field is crippled, or not
form Returns a reference to the structure that contains the date field
list Returns a reference to the datalist that contains the date field
max Sets or returns the estimation of the maximum property of the date field
min Sets or returns the estimation of the min property of the date field
name Sets or returns the estimation of the name trait of a date field
readOnly Sets or returns whether the date field is perused just, or not
required Sets or returns whether the date field must be rounded out before presenting a form
step Sets or returns the estimation of the progression quality of the date field
type Returns which kind of structure component the date field is
value Sets or returns the estimation of the esteem property of a date field

Input Date Object Methods

Method Description
stepDown() Decrements the estimation of the date field by a predefined number
stepUp() Increments the estimation of the date field by a predetermined number