x
 
<!DOCTYPE html>
<html>
<body>
月: <input type="month" id="myMonth" step="3">
<p>点击按钮可显示月份字段的 step 属性的值。</p>
<button onclick="myFunction()">试一试</button>
<p><b>注意:</b>Internet Explorer/Edge 或 Firefox 不支持 step 属性。</p>
<p id="demo"></p>
<script>
function myFunction() {
  var x = document.getElementById("myMonth").step;
  document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>