日本語
<!-- この効果を実現するには、3 つの手順が必要です。 ステップ 1: 次のコードを <head> 領域に追加します --> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var byear = prompt('Pleaseあなたの誕生年を入力してください','1976'); var mm = プロンプト('誕生月を入力してください','6'); var bday = プロンプト('生年月日を入力してください','10'); var year = new Date(); var year2 = year.getyear(); var year3 = (年 < 2000) : year2 : thedate = new Date() + 1; = thedate.getDate(); yy2 = thedate.getyear(); if (yy2 < 100) yy2 += 1900 yourrage = yy2 - byear; if ((mm2 == mm) && ( dd2 < bday)) yourage--; TMonth = new Array( '1 月'、'2 月'、'3 月'、'4 月'、'5 月'、'6 月'、'7 月'、'8 月'、'9 月' , '10月', '12月' ); CurMonth = mm - 1; var age2 = yourage + 1; var timerRunning = new Date(); var startday = new Date(); var minPerDay = 0; var secsRound = 0; ; var minRound = 0; var timeRemain = 0; 関数 stop Clock() { showtime(); ) ; } 関数 showtime() { today = new Date(); enday = new Date(""+bmonth+", "+year3+" 00:00"); ) ; 1日あたりの秒数 = 60 * 1000; 1日あたりの時間 = 24 * 60 * 60 * 1000; Math .round(secsLeft); secsRemain = (secsRemain < 0) secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound); (secsRemain); minLeft = ((endday.getTime() - today.getTime()) / hoursPerDay); minRemain = minLeft - minRemain = 60; - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60); minRemain = Math.round(minRemain - 0.495); hoursLeft = ((endday.getTime() - today.getTime()) / hoursRound = Math.round(hoursLeft); hoursRemain = hoursLeft - hoursRound; hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24 ); hoursRemain = Math.round(hoursRemain - 0.5); daysLeft = ((endday.getTime() - today.getTime()) / PerDay); daysLeft = (daysLeft - 0.5); daysRound; if (daysRemain == 1) day_rem = " 日、" else day_rem = " 日、" if (hoursRemain == 1)hour_rem = " 時間、" elsehour_rem = " 時間、" if (minRemain == 1 ) min_rem = " minutes, " else min_rem = " minutes, " if (secsRemain == 1) sec_rem = " 秒" else sec_rem = " 秒" timeRemain = daysRemain + day_rem + hoursRemain +hour_rem + minRemain + min_rem + secsRemain + sec_rem; down.face.value = timeRemain; timerID = setTimeout("showtime()",1000); timerRunning = true; if (daysRemain < 0) year3 = year3 + 1 } function showtime1() { startday = new Date(" "+ bmonth+" "+bday+", "+byear+" 00:00 EDT"); 今日 = 新しい日付 = 1000 * 1000; * 60 * 1000; 秒単位 = (today.getTime() - startday.getTime()) / 秒単位 = 秒残り = 秒残り = (秒残り < 0) 秒残り = 60 - ((秒ラウンド - 秒左) * 60) : 秒残り = (秒残り - 秒残り) = ((today.getTime() - 開始日) .getTime()) / hoursPerDay); minRound = Math.round(minLeft); minRemain = (minRemain < 0) minRemain = (( minLeft - minRound) * 60); minRemain = Math.round(minRemain - 0.495); hoursLeft = ((today.getTime() - startday.getTime()) / PerDay); hoursLeft - hoursRound; hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24) : hoursRemain = Math.round(hoursRemain - 0.5); = ((today.getTime() - startday.getTime()) / PerDay); daysLeft = (daysLeft - 0.5); daysRound = Math.round(daysLeft); if (daysRemain == 1) day_rem = " days, " else day_rem = " days, " if (hoursRemain == 1)hour_rem = " hours, " elsehour_rem = " hours, " if (minRemain == 1) min_rem = " minutes, " else min_rem = " minutes , " if (secsRemain == 1) sec_rem = " 秒" else sec_rem = " 秒" timeRemain = daysRemain + day_rem + hoursRemain +hour_rem + minRemain + min_rem + secsRemain + sec_rem; document.up.face.value = timerID = setTimeout; "showtime1()",1000); } // 終了 --> </script> <!--ステップ 2: 次のコードを <body> 領域に追加します --> <center> <フォーム名> ="down" onSubmit="0"> <script Language="JavaScript"> document.write("<b>あなたの生年月日は: "+byear+" year "+mm+" month "+bday+" day . ("+ mm+"/"+bday+"/"+byear+")</b>"); document.write("<br><br>今年、あなたは "+yourage+" 歳で、"+age2+" "歳:"); </script> <br> <input type="text" name="face" size="47" value="JavaScript 1.1 以降をサポートするブラウザが必要です。"> </form> <p > <br> <form name="up" onSubmit="1"> あなたがこの世界でどれくらい生きるかは次のとおりです<br> <input type="text" name="face" size="47" value= " JavaScript 1.1 以降をサポートするブラウザが必要です。"> </form> </center> <!--ステップ 3: <body> タグに「OnLoad="startlock()"」を追加します。例: --> <本体 OnLoad="start Clock()">