2 回答

TA貢獻1744條經驗 獲得超4個贊
1 <head>
2 <script type="text/javascript">
3 function getdate()
4 {
5 var day=new Date();
6 document.getElementById("daydate").innerHTML=day.getFullYear()+"年"+((day.getMonth()+1)>9?(day.getMonth()+1):"0"+
7 (day.getMonth()+1))+"月"+(day.getDate()>9?day.getDate():"0"+day.getDate())+"日"+(day.getHours()>9?day.getHours():"0"+
8 day.getHours())+":"+(day.getMinutes()>9?day.getMinutes():"0"+day.getMinutes())+":"+(day.getSeconds()>9?day.getSeconds():"0"+ day.getSeconds());
9 }
10 window.setInterval("getdate()",1000);
11 </script>
12
13 </head>
14 <body>
15 <form id="form1" runat="server">
16 <div>
17 <asp:Label runat="server" ID="daydate" Text=""></asp:Label>
18 <input type="button" onclick="alert('123');" value="123" />
- 2 回答
- 0 關注
- 781 瀏覽
添加回答
舉報