<html>
<body>
<input type="week" id="myWeek" value="2023-W01">
<p>单击该按钮可显示星期字段的默认值。</p>
<button type="button" onclick="myFunction()">试一试</button>
<p><b>注意:</b>Internet Explorer 或 Firefox 不支持带有 type="week" 的输入元素。</p>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myWeek").defaultValue;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>