x
 
<!DOCTYPE html>
<html>
<body>
时间:<input type="time" id="myTime" readonly>
<p>单击按钮可查看时间字段是否为只读。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("myTime").readOnly;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>