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

HTML DOM Input Datetime type property

Input Datetime type property

Input Datetime Object Reference Input Datetime Object

Example

Returns the form element type of the datetime field:

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

xOutput value:

datetime

Try it »


Definition and Usage

The type property returns the form type of the datetime field.

Note: In the example above, Safari and Opera 12 (and earlier versions) browsers return "datetime", while Opera 15 (and later versions), Internet Explorer, Firefox and Chrome browsers return "text".


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type attribute.

Note: In the example above, Internet Explorer, Firefox, Opera version 15 (and later) or Chrome browsers do not support it .


Syntax

datetimeObject

.type

Technical Details

Return Value: String representing the form element type of the datetime field

Input Datetime Object Reference Input Datetime Object