标签:
1 <!DOCTYPE html> 2 <html> 3 <body> 4 5 <p>点击按钮就可得到一个时钟</p> 6 7 <button onclick="displayDate()">click here!</button> 8 9 <script> 10 function displayDate() 11 { 12 document.getElementById("demo").innerHTML=Date(); 13 window.setInterval("displayDate()",1000); 14 } 15 16 </script> 17 18 <p id="demo"></p> 19 20 </body> 21 </html>
标签:
原文地址:http://www.cnblogs.com/coat/p/4844553.html