<html>
<body>
生日: <input type="date" id="myDate">
<p>点击按钮设置 date 字段的日期。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("myDate").value = "2014-02-09";
}
</script>
</body>
</html>