x
 
<!DOCTYPE html>
<html>
<body>
<form id="myForm">
  时间:<input type="time" id="myTime">
</form>
<p>点击按钮可返回时间字段所属表单的 id。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("myTime").form.id;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>