Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Date type attribute

Input Date type attribute

Input Date Object Reference Input Date Object

Example

Return the form element type of the date field:

var x = document.getElementById("myDate").type;

x

The output is:

date

Try it »


Definition and Usage

The type attribute returns the form element type of the date field.

Note: In the example above, Opera, Chrome and Safari return "date", while 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 .


Syntax

inputdateObject

.type

Technical Details

Return Value: A string representing the form element type of the date field

Input Date Object Reference Input Date Object