Javascript Reference - HTML DOM Input Time type Property








The type property get type string of the time field.

Browser Support

type Yes No No Yes Yes

Syntax

var v = timeObject.type 

Return Value

A String type value representing the type of the time field.





Example

The following code shows how to get type string of the time field.


<!DOCTYPE html>
<html>
<body>
<!--   w  w w . j a  v  a  2 s.c o m-->
<input type="time" id="myTime">
<button onclick="myFunction()">test</button>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myTime").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

The code above is rendered as follows: