Javascript Reference - HTML DOM Input Time form Property

The read onlyform property get the form containing the time field.

Browser Support

form Yes Yes Yes Yes Yes


var v = timeObject.form 

Return Value

A reference to the form element containing the time field. If the time field is not in a form, null is returned.


The following code shows how to get the id of the form containing the <input type="time"> element.

<!DOCTYPE html>
<!--from w  w  w . j av  a  2 s  .  com-->
<form id="myForm">
  Time: <input type="time" id="myTime">
<button onclick="myFunction()">test</button>

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

function myFunction() {
    var x = document.getElementById("myTime");
    document.getElementById("demo").innerHTML = x;


The code above is rendered as follows: