HTML DOM Input Date objects
Input Date Object
Input Date object is a new HTML5.
Input Date object represents use type = "date" attribute of the HTML <input> elements.
Note: Internet Explorer or Firefox does not support the use of type = "date" <input> element attributes.
Access Input Date objects
You can use a use getElementById () function to access using type = "date" attribute of the <input> element:
var x = document.getElementById ( "myDate" ); try
Tip: You can also form elements to access Input Date object set.
Create Input Date objects
You can use document.createElement () method to create using the type = "date" attribute of the <input> element:
var x = document.createElement ( "INPUT");
x.setAttribute ( "type", "date "); try
x.setAttribute ( "type", "date "); try
Input Date object properties
Property | description |
---|---|
autocomplete | Sets or returns the date field autocomplete attribute value |
autofocus | Sets or returns the date field whether to automatically get the focus when the page loads |
defaultValue | Sets or returns the default value of a date field |
disabled | Sets or returns the date field is available |
form | Returns a reference to the date field of the form |
list | It returns a reference to the date field datalist |
max | Sets or returns the date field max attribute value |
min | Sets or returns the property value of the date field min |
name | Sets or returns the date field name attribute value |
readOnly | Sets or returns the date field is read-only |
required | Sets or returns whether a date field in the form is a required field |
step | Sets or returns the date field step property values |
type | Returns the type of form field date |
value | Sets or returns the date field value attribute value |
Standard properties and events
Input Date Object also supports standard attributes and events .
related articles
HTML Tutorial: HTML Forms
HTML Reference Manual: HTML <the INPUT> tag
HTML Reference Manual: HTML <the INPUT> of the type attribute