Input Time type Attribute

Definition and Usage

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

Note:In the following example, Opera, Chrome, and Safari return "time, while Internet Explorer/Edge and Firefox return "text".

Example

The returned time field is which type of form element:

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

Try It Yourself

Syntax

timeObject.type

Technical Details

Return Value: A string value that represents the form element type of the time field.

Browser Support

The numbers in the table indicate the first browser version that fully supports this property.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 10.0 Support Support Support

Note:The <input type="time"> element does not display as any time field in Firefox.