Input Time type Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Time


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>

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

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

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

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


Related Tutorials