<html>
<body>
日期控件: <input type="date" id="myDate">
<p>点击按钮返回 date 字段的表单元素类型。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myDate").type;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>