x
 
<!DOCTYPE html>
<html>
<body>
时间:<input type="time" id="myTime" step="2">
<p>单击该按钮可更改时间字段(秒间隔)的 step 属性值。</p>
<p><b>提示:</b>在单击按钮前后,请尝试在时间字段的秒部分中使用向上或向下箭头。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  document.getElementById("myTime").step = "10";
  document.getElementById("demo").innerHTML = "步骤属性的值已从“2”更改为“10”。";
}
</script>
</body>
</html>