Latest web development tutorials

HTML DOM Input Date type property

Input Date Object Reference Input Date Object

Examples

Return form element types with date fields:

var x = document.getElementById("myDate").type;
x The output is:
date

try it"

Definition and Usage

type property returns the date field form element type.

Note: In the above example, Opera, Chrome and Safari return "date", Internet Explorer and Firefox return "text".


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type attribute.

Note: Internet Explorer or Firefox browser does not support <input type = "date"> element.


grammar

inputdateObject .type

technical details

return value: String representing the form element date field type


Input Date Object Reference Input Date Object