Input Time typeAttribute

Input Time 对象参考手册Input Time Object

Example

Return the form element type of the time field:

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

xThe output value is:

time

Try it Yourself »

Definition and Usage

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

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type attribute

Note:Internet Explorer and Firefox browsers do not support HTML <input> elements with type="time" attribute.


Syntax

timeObject.type

Technical Details

Return value: A string representing the form element type of the time field.


Input Time 对象参考手册Input Time Object Other Extensions