xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<title>高手教程(study.p2hp.com)</title>
</head>
<body>
生日: <input type="date" id="myDate">
<p>点击按钮设置 date 字段为只读。</p>
<p><strong>提示:</strong> 为了查看效果,你可以先点击 date 字段设置日期,然后点击按钮。</p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction() {
document.getElementById("myDate").readOnly = true;
}
</script>
</body>
</html>