fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <body> <p id="demo">Click the button to display the date after changing the month and day.</p> <button onclick="myFunction()">点我测试</button> <script> function myFunction() { var d = new Date(); d.setUTCMonth(4,20); var x = document.getElementById("demo"); x.innerHTML=d; } </script> </body> </html>
运行结果