The type
property get type string of the time field.
type |
Yes | No | No | Yes | Yes |
var v = timeObject.type
A String type value representing the type of the time field.
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: