<div class="codetitle"> <span><a style="CURSOR: pointer" data="1827" class="copybut" id="copybut1827" onclick="doCopy('code1827')"><u>コードをコピーします</u></a></span> コードは次のとおりです。</div> <div class="codebody" id="code1827"> <br><html> <br><head> 🎜><title>JavaScript は現在時刻を表示するページを実装します</title> <br><body> <br><script language="javascript"> <br>関数 showtime() <br>{ <br>var 今日、時、秒、分、年、月、日付; <br>today=new Date(); = today.getDay(); <br>switch (n_day) <br>{ <br>case 0:{ <br>strDate = "日曜日" <br>}break; <br>case 1:{ <br>strDate = "月曜日" <br>}休憩; <br>ケース 2:{ <br>strDate = "火曜日" <br>}休憩; <br>ケース 3:{ <br>strDate = "水曜日" <br>}ブレーク; <br>ケース 4:{ <br>strDate = "木曜日" <br>}ブレーク; <br>ケース 5:{ <br>strDate = "金曜日" <br>}ブレーク; { <br>strDate = "土曜日" <br>}休憩; <br>ケース 7:{ <br>strDate = "日曜日" <br>}休憩 <br>} <br>年 = today.get Year() ; <br>月 = today.getMonth() ; <br>日付 = today.getHours(); <br>分 =today.getMinutes(); = today.getSeconds() ; <br>if(monthif(hourif(分if(秒document.getElementById('time') = year "year" month "Month" date "Day" strDate " " 時 ":" 分 ":" 秒 // 表示時間<br>setTimeout("showtime();", 1000);関数の実行時間を 1000 ミリ秒 (1 秒) にします <br>} <br></script><br><div id="time"></div><br><script language= "javascript"> showtime() ;</script><br></body><br><br> </div>