编辑下面的代码:【加编码】
<html> <body> <p id="demo">Click the button to display a specified date after changing the day of the month.</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var d = new Date("July 21, 1983 01:15:00"); d.setDate(15); var x = document.getElementById("demo"); x.innerHTML=d; } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂