時計の表示 Web Technique
Last modified : 2006/04/11


↓ ソース
<HTML>
<HEAD>
<TITLE>HISOAP - Web Technique [ 時計の表示 ]</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function Clock1(){
    myDate=new Date();
    myHour=myDate.getHours();
    myMinute=myDate.getMinutes();
    mySecond=myDate.getSeconds();
    if(myHour<10)  { myHour="0"+myHour }
    if(myMinute<10){ myMinute="0"+myMinute }
    if(mySecond<10){ mySecond="0"+mySecond }
    document.myform1.myclock.value=" "+myHour+"時"+myMinute+"分"+mySecond+"秒";
    setTimeout("Clock1()",1000); // 1秒毎に "Clock1" を呼び出す
}
//-->
</SCRIPT>
</HEAD>

<BODY onload="Clock1()">

<FORM name="myform1"><INPUT name="myclock" size="16"></FORM>

</BODY>
</HTML>