Input Time type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Time

Description

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

Return Value

A String, representing the type of form element the time field is

The following code shows how to return which type of form element the time field is:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="time" id="myTime">

<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {//from ww  w  . j  ava  2 s  .  com
    var x = document.getElementById("myTime").type;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials