编辑下面的代码:【加编码】
<html> <body> <p>Click the button to execute the <em>displayDate()</em> function.</p> <button onclick="displayDate()">Try it</button> <script> function displayDate() { document.getElementById("demo").innerHTML=Date(); } </script> <p id="demo"></p> </body></html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂