この記事では、JSが数秒に正確な日付セレクターの実装について説明します。次のように、参照のために共有してください。
<script> //メインコール関数は、setDay(this、[object])およびsetday(this)です。 [オブジェクト]は、コントロールによるコントロール名の出力です。 2つの例を示します。<入力名= txt> <入力タイプ=ボタン値= setday onclick = "setday(this、document.all.txt)"> // 2。 Z-Index:9998; display:none "> </iframe> '); strframe =' <style> '; strframe+=' input.button {border-right:#63a3e9 1px solid; 1px solid; background-color:#63a3e9; font-family:安安;} '; strframe+=' td {font-size:9pt; font-family:安安安;} '; strframe+=' </style> '; strframe+=' <sc+'ipt> bdrag; '; strframe+=' function document.onmousemove() '; strframe+=' {if(bdrag && window.event.button == 1) '; strframe+=' {var dateLayer = parent.document.all.enddatelayer.style; window.event.clientx-datelayerx; '; strframe+=' datelayer.postop+= window.event.clienty-datelayery;}} '; strframe+=' function dragstart() '; strframe+=' {var dateleayer = parent.document.all.All.EndteLameer.Style+ dateLayerx = window.event.clientx; '; strframe+=' datelayery = window.event.clienty; '; strframe+=' bdrag = 'bdrag ='; strframe+= 'function dragend(){'; strframe+= 'bdrag = false;}'; strframe+= '< style = "z-index:9999; position:absolute; left:0; top:0;" onselectStart = "return false"> '; strframe+=' <span id = tmpselectyearlayer style = "z-index:9999; position:absolute; absolute; fot:3; left:19; display:none"> </span> '; strframe+=' <span id = tmpselectmonthlayer style = "z-index:999; posit 78; display:none "> </span> '; strframe+=' <span id = tmpselecthourlayer style =" z-index:9999; position:absolute:35px; display:none "> </span> '; strframe+=' <span id = tmpeselectminutmineer =" z-index: " 188左:77px; display:none "> </span> '; strframe =' <tmpselectsecondlayer style =" z-index:9999;位置:絶対;左:188; bordercolor =#63a3e9 bgcolor =#63a3e9> '; strframe+=' <tr> <td width = 142 height = 23 bgcolor =#ffffff> '; strframe+=' <テーブル境界= 0セルペーシング= 1セルパディング= 0 width = 0 width = 158 height = 23> '; strframe ='; <td width = 16 align = center bgcolor =#63a3e9 style = "font-size:12px; cursor:hand; color:#ffffff" '; strframe+=' onclick = "parent.meizzprevm()"> <b> <</b> </td> bgcolor = "#63a3e9" style = "font-size:12px; cursor:hand" '; strframe+=' onmouseover = "style.backgroundcolor =/'#aaccf3/'" '; strframe+=' onmouseout = "style.backgroundcolor =/'#63a3e9/' '' '' '' onclick = "parent.tmpseerectyearinhtml(this.innertext.substring(0,4))" '; strframe+='> <span id = meizzyearhead> </span> </td> '; strframe+=' <td width = 48 align = "center" style = "font-size; fpct; fut-color '; strframe+=' bgcolor = "#63a3e9" onmouseover = "style.backgroundcolor =/'#aaccf3/'" '; strframe+=' onmouseout = "style.backgroundcolor =/'#63a3e9/'" '; strframe+=' onclick = "parent.tmpselectmonthinnerhtml(this.innertext.length == 3?this.innertext.substring(0,1):this.innertext.substring(0,2))" '; strframe+='> <span id = meizzmonthhhood> </td> ' bgcolor =#63a3e9 align = center style = "font-size:12px; cursor:hand; color:#ffffff" '; strframe+=' onclick = "parent.meizznextm()"> <b >> </b> </td> '; strframe+='; </table> </td> </tr> '; strframe+=' <tr> <td width = 142 height = 18> '; strframe+=' <table border = 0 cellpacing = 0 cellpadding = 2 bgcolor =#63a3e9 '+(bmoveable?' onmoused " bordercolorlight =#63a3e9 bordercolordark =#fffffff width = 140 height = 20 style = "cursor: ' +(bmovable?' move ':' default ') +'"> '; str> <td style = "font-size:12px; coler:#fffffffffffffffffffffff style = "font-size:12px; color:#ffffff"> one </td> <td style = "font-size:12px; color:#ffffff"> t </td> '; strframe+=' <td style = "font-size:12px; color:#fffffffff"> 1つ</td> <td style = "font-size:12px; color:#ffffff"> t </td> '; strframe+=' <td style = "font-size:12px; color:#ffffff"> one </td> <td style = "font-size:12px; color:#ffffff"> one </td> '; strframe+' <td style = "font-size:12px; color:#ffffff"> six </td> <td style = "font-size:12px; color:#ffffff"> 6 </td> <td style = "font-size:" font-size:color:#ffffff "> six </td> </tr> > '; strframe+=' <tr> <table border = 1 cellpacing = 2 cellpadding = 2 bordercolorlight =#63a3e9 bordercolordark =#fffff bgcolor =#fff8ec width = 140 height = 120> '; var n = 0; for(j = 0; j <5; j ++){strframe+= '<tr align = center>'; for(i = 0; i <7; i ++){strframe+= '<td width = 20 heigh = 20 id = meizzday'+n+'style = "font-size:" onclick = parent.meizzdayclick(this.innertext、0)> </td>'; n ++} (i = 35; i <37; i ++)strframe+= '<td width = 20 height = 20 id = meizzday'+i+'style = "font-size:" onclick = "onclick =" parent.meizzdayclick(this.innertext、0) "> </td>'; strframe = '<td Colspan = 5 align =" onclick = "parent.setnull()" style = "font-size:12px; cursor:hand" '; strframe+=' onmouseover = "style.color =/'#ff0000/'" onmouse = "style.color =/'#1478eb/'"> style = "font-size:12px; cursor:hand" '; strframe+=' onmouseover = "style.color =/'#ff0000/'" onmouseout = "style.color =/'#1478EB/'" onmouseout = "style.color =/'#1478eb/'" onclick = "parent.closelayer()"> close </span> </td> </tr> '; strframe+=' </table> </td> </tr> <tr <td> '; strframe+=' <table border = 0 widcacing = 1 100%= 1 100% bgcolor =#ffffff height = 22> '; strframe+=' <tr bgcolor = "#63a3e9"> <td id = busetimelayer width = 30 style = "cursor:" '; strframe+=' onmouseover = "style.backgroundcolor =/'#aaccf3/'" align = center onmouseout = "style.backgroundcolor =/'#63a3e9/'" '; strframe+=' onclick = "parent.usetime(this)"> '; strframe+=' <span> </span> </td> '; onclick = "parent.tmpselecthourinnerhtml(this.innertext.length == 3?this.innertext.substring(0,1):this.innertext.substring(0,2))" '; strframe+=' onmouse = "style.backgroundcolor =/'#aaccf3/'" onmouseout = "style.backgroundcolor =/'#63a3e9/'" '; strframe+=' align = center width = 42> '; strframe+=' <span id = meizzhourhead> </td> '; strframe+=' <td style = "cursor:hand" onclick = "parent.tmpselectminuteinnerhtml(this.innertext.length == 3?this.innertext.substring(0,1):this.innertext.substring(0,2))" '; strframe+=' onmouse = "style.backgolor =/'#aaccf3/'" " onmouseout = "style.backgroundcolor =/'#63a3e9/'" '; strframe+=' align = center width = 42> '; strframe+=' <span id = meizzminutehead> </span> </td> '; strframe+=' <td style = "cursor:hand" onclick = "parent.tmpselectsecondinnerhtml(this.innertext.length == 3?this.innertext.substring(0,1):this.innertext.substring(0,2))" '; strframe+=' onmouse = "style.backcolor =/'#aaccf3/'" "#aaccf3/'" onmouseout = "style.backgroundcolor =/'#63a3e9/'" '; strframe+=' align = center width = 42> '; strframe+=' <span id = meizzsecondhead> </span> </td> '; strframe+=' </tr> </td> </tr> </table> </div> '; window.frames.enddatelayer.document.writeln(strframe); window.frames.enddatelayer.document.close(); // IE Progress Barがない問題を解決します終了// ================================================================================================ ========================================================================== ========================================================================== Webページの表示パート=================================================================================== ============================================================================== ============================================================================== ============================================================================== ============================================================================== ============================================================================== ============================================================================== ============================================================================== odatelayer = window.enddatelayer.document.all; // odatelayer.busetimelayer.innertext = "no"; bimgswitch(); odatelayer.busetimelayer.innerhtml = bimg; function setday(tt、obj)// main cultions {alt.パラメーターはこのコントロールに渡されました! "); return;} if(arguments.length == 0){alert("申し訳ありません!このコントロールにパラメーターを渡しませんでした! ");} var dads = document.all.enddateLayer.style; var th = tt; var ttop = tt.offtettop; // TTコントロールの位置決めポイントは高いvarです= tt.clientheight; // TTコントロール自体の高VARはTLEFT = TT.OFFSETLEFTです。 // TTコントロールの位置決めポイントは、var ttyp = tt.typeです。 // TTコントロールのタイプは(tt = tt.offsetparent){ttop+= tt.offsettopです。 tleft+= tt.offsetleft;} dads.top =(ttyp == "image")? ttop+thei:ttop+thei+6; dads.left = tleft; outobject =(arguments.length == 1)? Th:obj; outbutton =(arguments.length == 1)? null:th; //外部クリックボタンを設定します//除外時間var r = outobject.value.match(reg); if(r!= null){r [2] = r [2] -1; var d = new Date(r [1]、r [2]、r [3]); if(d.getFullyear()== r [1] && d.getmonth()== r [2] && d.getdate()== r [3]){oututdate = d; parent.meizztheyear = r [1]; parent.meizzthemonth = r [2]; parent.meizzthedate = r [3]; } else {outdate = ""; } meizzsetday(r [1]、r [2] +1);} else {outdate = ""; meizzsetday(new date()。getFullyear()、new date()。getmonth() + 1);} dads.display = ''; //初期化中に使用時間が使用されるかどうかを判断します。 bimgswitch(); odatelayer.busetimelayer.innerhtml = bimg; meizzwritehead(meizztheyear、meizzthemonth); //} // else // {// busetime = false; // bimgswitch(); // odatelayer.busetimelayer.innerhtml = bimg; // meizzwritehead(meizztheear、meizzthemanth); catch; // (e){//ここでエラーは除外されていますが、エラーの原因はまだ見つかりません。 }} var monhead = new Array(12); //グレゴリオカレンダーモンヘッド[0] = 31で月額最大日数を定義します。 Monhead [1] = 28; Monhead [2] = 31; Monhead [3] = 30; Monhead [4] = 31; Monhead [5] = 30; Monhead [6] = 31; Monhead [7] = 31; Monhead [8] = 30; Monhead [9] = 31; Monhead [10] = 30; Monhead [11] = 31; var meizztheyear = new date()。getFullyear(); //年の変数の初期値を定義しますvar meizzthemonth = new date()。getMonth()+1; //月の変数の初期値を定義しますvar meizzthedate = new date()。getDate(); // day var meizzthehour = new date()。gethours()の変数の初期値を定義します。 //時間変数の初期値を定義しますvar meizztheminute = new date()。getminutes(); // minute変数の初期値を定義しますvar meizzthesecond = new date()。getSeconds(); // 2番目の変数の初期値を定義しますvar meizzwday = new Array(37); //書き込み日付を定義する配列document.onclick =(function(){with(window.event){if(srcelement!= outobject && srcelement!= closeLayer();}})document.onkeyup =(function(){if(window.event.keycode = = 27){if(outobject) closeLayer();} else if(document.activeElement){if(document.activeElement!= outobject && document.activeElement!= outbutton){closeLayer()}}}; "year"; odatelayer.meizzmonthhead.innertext = format(mm)+"moon"; //現在の時間と微細なodatelayer.meizzhourhead.innertext = busetime?(meizzthehour+"time"): ""; ""; Minutes "):" "; odatelayer.meizzsecondhead.innertext = busetime?(meizzthesecond+"秒 "):" ";} function tmpseerectyearinnerhtml(stryear)//ドロップダウンボックス番号! "); return;} var m =(stryear)? stryear:new date()。getFullyear(); if(m <1000 || m> 9999){alert( "年の値は1000から9999の間ではありません!"); return;} var n = m -50; if(n <1000)n = 1000; if(n + 101> 9999)n = 1000; 12px '"s +=" onblur =' document.all.all.al.tmpselectyearlayer.style.display =/"none/" '"s +=" onchange =' document.all.all.al.display =/"none/"; "s +" parent.meizzsetday(parent.meizztheyear、parent.meizzthemonth) '>/n "; var selectinnerhtml = s; } else {selectinnerhtml + = "<option value = '" + i + "'>" + i + "year" + "</option>/r/n"; }} selectinnerhtml += "</select>"; odatelayer.tmpseearlayer.style.display = ""; odateLayer.tmpselectyearlayer.innerhtml = selectinnerhtml; odateEar.tmpseear.focus(); tmpselectmonthinnerhtml(strmonth)//月のプルダウンボックス{if(strmonth.match(// d/)!= null){alert( "月入力パラメーターは数字ではありません!");} var m =(stronth)? stronth:new date()。getMonth() +1; var s = "<select name = tmpselectmonth style = 'font-size:12px'" s += "onblur = 'document.all.all.al.tmpselectmonthlayer.style.display =/" none/"'" s += "onchange = 'document.all.al.tmpselectmonthlayer.style.display =/" none/";" s+= "parent.meizzthemonth = this.value; parent.meizzsetday(parent.meizztheyear、parent.meizzthemonthth)'>/r/n" (i == m){selectinnerhtml+= "<option value = '"+i+"' selected>"+i+"month"+"</option>/r/n"; } else {selectinnerhtml+= "<option value = '"+i+"'>"+i+"month"+"</option>/r/n"; }} selectinnerhtml += "</select>"; odatelayer.tmpselectmonthlayer.style.display = ""; odatelayer.tmpselectmonthlayer.innerhtml = selectinnerhtml; odateLayer.tmpselectmonth.furtocus(); tmpselecthourinnerhtml(strhour)// hour dropdown box {if(!busetime){return;} if(strhour.match(// d/)!= null){alert( "hour inputパラメーターは数字ではありません!"); return;} var m =(strhour)? strhour:new date()。gethours(); var s = "<select name = tmpselecthour style = 'font-size:12px'" s += "onblur = 'document.all.all.al.tmpselecthourlayer.style.display =/" none/"'" s += "onchange = 'document.all.al.tmpselecthourlayer.style.display =/" none/";" s+= "parent.meizzthehour = this.value; parent.evasettime(parent.meizzthehour、parent.meizztheminute);'>/r/n"; if(i == m){selectinnerhtml+= "<option value = '"+i+"' selected>"+i+"</option>/r/n"; } else {selectinnerhtml+= "<option value = '"+i+"'>"+"</option>/r/n"; }} selectinnerhtml += "</select>"; odatelayer.tmpselecthourlayer.style.display = ""; odatelayer.tmpselecthourlayer.innerhtml = selectinnerhtml; odateLayer.tmpselecthour.focus(); tmpselectminuteinnerhtml(strminute)// minuteドロップダウンボックス{if(!busetime){return;} if(strminute.match(// d/)!= null){alert( "minute inputパラメーターは数ではありません!"); return;} var m =(strminute)? strminute:new date()。getminutes(); var s = "<select name = tmpselectminute style = 'font-size:12px'" s += "onblur = 'document.all.all.al.tmpselectminutelayer.style.display =/" none/"'" s += "onchange = 'document.all.al.tmpselectminutelayer.style.display =/" none/";" s += "parent.meizztheminute = this.value; parent.evasettime(parent.meizzthehour、parent.meizztheminute);'>/r/r/n" i ++){if(i == m){selectinnerhtml+= "<option value = '"+i+"' selected>"+i+"</option>/r/n"; } else {selectinnerhtml+= "<option value = '"+i+"'>"+"</option>/r/n"; }} selectinnerhtml += "</select>"; odateLayer.tmpselectminutelayer.style.display = ""; odateLayer.tmpselectminutelayer.innerhtml = selectionnerhtml; odateLayer.tmpselectminute.fuction.ferectminute.fercus( tmpselectsecondinnerhtml(strsecond)// 2番目のドロップダウンボックス{if(!busetime){return;} if(strsecond.match(// d/)!= null){alert( "minute inputパラメーターは数ではありません!"); return;} var m =(strsecond)? strsecond:new date()。getminutes(); var s = "<select name = tmpselectsecond style = 'font-size:12px'" s += "onblur = 'document.all.all.al.tmpselectsecondlayer.style.display =/" none/"'" s += "onchange = 'document.all.tmpselectsecondlayer.style.display =/" none/";" s += "parent.meizzthesecond = this.value; parent.evasettime(parent.meizzthehour、parent.meizztheminute、parent.meizzerhnnerhtond);'>/r/n"; '>/r/n " 0; i <60; } else {selectinnerhtml+= "<option value = '"+i+"'>"+"</option>/r/n"; }} selectinnerhtml += "</select>"; odatelayer.tmpselectsecondlayer.style.display = ""; odatelayer.tmpselectsecondlayer.innerhtml = selectionnerhtml; odateLayer.tmpselecteCond.ferecond.ferecond.ferecond.ferecond.ferecond.ferecond.ferecn layer {var o = document.getElementbyId( "enddatelayer"); if(o!= null){o.style.display = "none";}} function showlay()//このレイヤーの閉鎖{document.all.All.EnddateLayer.style.display = " (0 ==年%4 &&((年%100!= 0)||(年%400 == 0))return true; else return fals;} function getmonthcount(year、month)// leap year of leap yearは29日{var c = mon-1]; if((月== 2)&& inspiny(year)c++; c++;特定の日の曜日{var c = monhead [mont-1]; if((month == 2)&& ispinyear(year))c ++; return c;} function getdow(day、month、year)//特定の日の曜日を見つけるdt;} function meizzprevy()// flip year {if(meizztheyear> 999 && meizztheyear <10000){meizztheyear - ;} elser( "year ound range(1000-9999)!」 year {if(meizztheyear> 999 && meizztheyear <10000){meizztheyear ++;} else {alert( "年の範囲外(1000-9999)!」) // dondaybutn button {parent.meizztheear = new datiear = new datiear()。getFliear(); getFreliar(); parent.meizzthemonth = newdate()。getMonth()。getMonth()。getMonth()。getMonth()+1; parent.meizzthedate = new date()。getDate()。getDate()。getDate()。getDate()。getDate()。getDate()。getDate()。getDate()。getDate()。getDate()。 date()。getminutes(); parent.meizzthesecond = new date()。getseconds(); var meizzthesecond = new date()。 (parent.meizzthedate <10 && parent.meizzthedate.length <2)// 2桁に{parent.meizzthedate = "0" + parent.meizzthedate;} // meizzsetday(meizztheear、meizzthemonth); format(parent.meizzthemonth) + " - " + format(parent.meizzthedate) + "" + format(parent.meizzthehour) + ":" + format(parent.meizztheminute) + ":" + format(parent.meizzthesecond); //注:ここで、出力を必要な形式に変更できます} else {outobject.value = parent.meizztheyear + " - " + format(parent.meizzthemonth) + " - " + format(parent.meizzthedate); //注:ここで、出力を必要な形式に変更できます}} closeLayer();} function meizzprevm()//フォローフォワード{if(meizzthemonth> 1){meizzthemonth - }月のbackward {if(meizzthemonth == 12){meizztheyear ++; meizzthemonth = 1} else {meizzthemonth ++} meizzsetday(meizztheyear、meizzthemonth);} // todo:コード関数Meizzsetday(yy、mm) ************* {meizzwritehead(yy、mm); //現在の年と月のパブリック変数を設定して、meizztheyear = yy; meizzthemonth = mm; for(var i = 0; i <37; i ++){meizzwday [i] = ""}; //ディスプレイボックスのすべての内容をクリアvar day1 = 1、day2 = 1、初日=新しい日付(yy、mm-1,1).getday(); //特定の月の最初の日の曜日(i = 0; i <初日; i ++)meizzwday [i] = getmonthcount(mm == 1?yy、mm == 1?12:mm-1)-pirstday+i+1 //前月の最後の数日間meizzwday [i] = day1; day1 ++; } for(i = firstday+getMonthCount(yy、mm); i <37; i ++){meizzwday [i] = day2; day2 ++; } for(i = 0; i <37; i ++){var da = eval( "odatelayer.meizzday"+i)//新しい月の日付と週のアレンジメント付きif(meizzwday [i]!= ""){// borderの初期化= 63a3e9 "; da.bordercolordark = "#63a3e9"; da.style.color = "#1478eb"; if(i <firstday)//先月の部分{da.innerhtml = "<b> <font color =#bcbabc>" + meizzwday [i] + "</font> </b>"; da.title =(mm == 1?12:mm-1) + "month" + meizzwday [i] + "day"; da.onclick = function( "meizzdayclick(this.innertext、-1)"); if(!outdate)da.style.backgroundcolor =((mm == 1?yy-1:yy-1:yy)== new date()。getFullyear()&&(Mm == 1?12:mm-1)== new date()。 "#5cefa0": "#f5f5f5"; else {da.style.backgroundColor =((mm == 1?yy-1:yy-yy)== outdate.get.fullyear()&&(mm == 1?12:mm-1)== outdate.getmonth() + 1 && meizzwday [i] == outdate.getdate())? "#84c1ff":(((mm == 1?yy-1:yy)== new date()。getFullyear()&&(mm == 1?12:mm-1)== newmonth()+1 && meizzwday [i] == new date()。getdate()) //選択された日付を凹面として表示しますif((mm == 1?yy-1:yy)== outdate.get.fullyear()&&(mm == 1?12:mm-1)== outdate.getmonth() + 1 && meizzwday [i] == outdate.getdate(){da.bordercolorlight = "#fffffff"; da.bordercolordark = "#63a3e9"; }}} else if(i> = firstday + getmonthcount(yy、mm))//来月のパート{da.innerhtml = "<b> <font color =#bcbabc>" + meizzwday [i] + "</font> </b>"; da.title =(mm == 12?1:mm + 1) + "month" + meizzwday [i] + "day"; da.onclick = function( "meizzdayclick(this.innertext、1)"); if(!outdate)da.style.backgroundcolor =((mm == 12?yy+1:yy)== new date()。getFlyear()&&(mm == 12?1:mm+1)== new date()。 "#5cefa0": "#f5f5f5"; else {da.style.backgroundcolor =((mm == 12?yy+1:yy)== outdate.get.fullyear()&&(mm = 12?1:mm+1)== outdate.getmonth()+1 && meizzwday [i] == outdate.getdate())? "#84c1ff":(((mm == 12?yy+1:yy)== new date()。getFullyear()&&(mm == 12?1:mm+1)== new Date()+1 && meizzwday [i] == new date()。 //選択された日付を凹面として表示するif((mm == 12?yy+1:yy)== outdate.get.fullyear()&&(mm == 12?1:mm+1)== outdate.getmonth()+1 && meizzwday [i] == outdate.getdate()){da.bordercolorlight = "#ffffff"; da.bordercolordark = "#63a3e9"; }}} else //今月の一部{da.innerhtml = "<b>" + meizzwday [i] + "</b>"; da.title = mm + "month" + meizzwday [i] + "day"; da.onclick = function( "meizzdayclick(this.innertext、0)"); // OnClickイベントの処理をTDに与える//それが現在選択されている場合、明るい青色の背景が表示されます。現在の日付の場合、濃い黄色の背景が表示されます。 "#5cefa0": "#f5f5f5"; else {da.style.backgroundColor =(yy == outdate.getTullyear()&& mm == outdate.getmonth() + 1 && meizzwday [i] == outdate.getDate())? "#84c1ff":((yy == new date()。getFullyear()&& mm == new date()。getmonth()+1 && meizzwday [i] == new date()。getDate())? "#5cefa0": "#f5f5f5"); //選択した日付をconcaveとして表示するif(yy == outdate.get.fullyear()&& mm == outdate.getmonth() + 1 && meizzwday [i] == outdate.getdate()){da.bordercolorlight = "#ffffff"; da.bordercolordark = "#63a3e9"; }}} da.style.cursor = "hand"} else {da.innerhtml = ""; da.style.backgroundcolor = ""; da.style.cursor = "default"; }}} function meizzdayclick(n、ex)//表示ボックスをクリックして日付を選択します。メインの入力関数********************* {parent.meizzthedate = n; var yy = meizztheyear; var mm = parseint(meizzthemonth)+es; // exは、前月の日付と来月の日付を選択するために使用されるオフセットを表します。 mm = 12+mm;} else if(mm> 12){yy ++; mm = mm-12;} if(mm <10){mm = "0" + mm;} if(hh <10){hh = "0" + hh;} // time if(mi <10){mi = "0 + mi;} //分//outobject.value = ""; return;} if(n <10){n = "0" + n;} writedateto(yy、mm、n、hh、mi、se); closelayer(); if(busetime){try {outbutton.click(); } catch(e){setday(outobject); }}} else {closelayer(); alert( "出力したいコントロールオブジェクトは存在しません!");}} function format(n)// {var m = new string(); new String(n); if(n <10 && tmp.length <2){m = "0"+n;} oles {m = nユーザーが選択した議事{odatelayer.meizzhourhead.innertext = meizzthehour+"time"; odatelayer.meizzminutehead.innertext = meizztheminute+"minute; odatelayer.meizzsecondhead.innertext = meizztext = meizztextexond+"秒 "; writedeto(meizztheyear、meizzthemonth、meizzthedate、meizzthehor、meizztheminute、meizzthesecond)} function evasettimenothing()//タイムコントロールをに設定しますempty {odatelayer.meizzhourhead.innertext = ""; odateLayer.meizzminute.innertext = ""; odateLayer.meizzsecondhead.innertext = ""; writedeto(meizzeear、meizzthementh、meizztheminecent、meizzthehour、meizzthehor、meizzthe、meizztheminete、meizzthethe、meizzthemineto) evasettimenow()//時間制御を現在の時刻に設定します{odatelayer.meizzhourhead.innertext = new date()。gethours()+"time"; odatelayer.meizzminutehead.innertext = new date()getMinutes()+"butines"; date()。getSeconds()+"秒"; meizzthehour = new date()。gethours(); meizztheminute = new date()。getminutes(); meizzthesecond = new date(); wrizedeto(meizzthemonth、meizzthehor、meizzthe -second)} {ctl){busetime;時間、ユーザーによって選択された時間evasettimenow();フォーマット(mm) + " - " + format(n) + "" + format(hh) + ":" + format(se); want}} function bimgswitch(){if(busetime){bimg = "on";} else {bimg = "off";}} </script> <input onfocus = "setday(this)" id = "starttime" name = "starttime">For more information about JavaScript, please check this site's special topics: "Summary of JavaScript Time and Date Operation Skills", "Summary of JavaScript Switching Effects and Skills", "Summary of JavaScript Search Algorithm Skills", "Summary of JavaScript Animation Special Effects and Skills", "Summary of JavaScript Errors and Debugging Skills", "Summary of JavaScript Data Structures and Algorithm Skills", 「JavaScriptトラバーサルアルゴリズムとスキルの概要」および「JavaScript数学的操作の使用の概要」
この記事がみんなのJavaScriptプログラミングに役立つことを願っています。