源代码:
下载代码
AI 编程工具
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title> </head> <body> 周和年: <input type="week" id="myWeek"> <p>点击按钮设置 week 字段的年和周。</p> <button onclick="myFunction()">点我</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myWeek").value = "2014-W48"; } </script> </body> </html>
运行结果: