<html>
<body>
<input type="month" id="myMonth">
<p>点击按钮返回 month 字段的表单元素类型。</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myMonth").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>