代码:--------------------------------------------------------------------------------<br>body {<br>background-color: #D4D0C8;<br>}<br>.m_fieldset {<br>padding: 0,10,5,10;<br>text-align: center;<br>width: 150px;<br>}<br>.m_legend {<br>font-family: Tahoma;<br>font-size: 11px;<br>padding-bottom: 5px;<br>}<br>.m_frameborder {<br>border-left: 2px inset #D4D0C8;<br>border-top: 2px inset #D4D0C8;<br>border-right: 2px inset #FFFFFF;<br>border-bottom: 2px inset #FFFFFF;<br>width: 100px;<br>height: 19px;<br>background-color: #FFFFFF;<br>overflow: hidden;<br>text-align: right;<br>font-family: "Tahoma";<br>font-size: 10px;<br>}<br>.m_arrow {<br>width: 16px;<br>height: 8px;<br>font-family: "Webdings";<br>font-size: 7px;<br>line-height: 2px;<br>padding-left: 2px;<br>cursor: default;<br>}<br>.m_input {<br>width: 18px;<br>height: 14px;<br>border: 0px solid black;<br>font-family: "Tahoma";<br>font-size: 9px;<br>text-align: right;<br>ime-mode:disabled;<br>}<br><br>//Written by cloudchen, 2004/03/15<br>function minute(name,fName)<br>{<br>this.name = name;<br>this.fName = fName || "m_input";<br>this.timer = null;<br>this.fObj = null;<br><br>this.toString = function()<br>{<br>var objDate = new Date();<br>var sMinute_Common = "class=\"m_input\" maxlength=\"2\" name=\""+this.fName+"\" onfocus=\""+this.name+".setFocusObj(this)\" onblur=\""+this.name+".setTime(this)\" onkeyup=\""+this.name+".prevent(this)\" onkeypress=\"if (!/[0-9]/.test(String.fromCharCode(event.keyCode)))event.keyCode=0\" onpaste=\"return false\" ondragenter=\"return false\"";<br>var sButton_Common = "class=\"m_arrow\" onfocus=\"this.blur()\" onmouseup=\""+this.name+".controlTime()\" disabled"<br>var str = "";<br>str += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"<br>str += "<tr>"<br>str += "<td>"<br>str += "<div class=\"m_frameborder\">"<br>str += "<input radix=\"24\" value=\""+this.formatTime(objDate.getHours())+"\" "+sMinute_Common+">:"<br>str += "<input radix=\"60\" value=\""+this.formatTime(objDate.getMinutes())+"\" "+sMinute_Common+">:"<br>str += "<input radix=\"60\" value=\""+this.formatTime(objDate.getSeconds())+"\" "+sMinute_Common+">"<br>str += "</div>"<br>str += "</td>"<br/>str += "<td>"<br/>str += "<table border="0" cellpacing="2" cellpadding="0">"<br> str += "<tr><td><button id=""+this.fName+"_up" "+sButton_Common+">5</button></td></tr>"<br>str += "<tr><td><button id=""+this.fName+"_down" "+sButton_Common+">6</button></td></tr>"<br>str + = "</table>"<br>str += "</td>"<br>str += "</tr>gt;"<br>str += "</table>"<br>return str;<br>}<br>これ。 play = function()<br>{<br>this.timer = setInterval(this.name+".playback()",1000);<br>}<br>this.formatTime = function(sTime)<br>{<br>sTime = ("0"+sTime) ;<br>return sTime.substr(sTime.length-2);<br>}<br>this.playback = function()<br>{<br>var objDate = new Date();<br>var arrDate = [objDate.getHours(),objDate.getMinutes( ),objDate.getSeconds()];<br>var objMinute = document.getElementsByName(this.fName);<br>for (var i=0;i<objminute.length></objminute.length>{<br>objMinute[i].value = this. formatTime(arrDate[i])<br>}<br>}<br>this.prevent = function(obj)<br>{<br>clearInterval(this.timer);<br>this.setFocusObj(obj);<br>var value = parseInt(obj.value,10) ;<br>var radix = parseInt(obj.radix,10)-1;<br>if (obj.value>radix||obj.value{<br>obj.value = obj.value.substr(0,1); <br>}<br>}<br>this.controlTime = function(cmd)<br>{<br>event.cancelBubble = true;<br>if (!this.fObj) return;<br>clearInterval(this.timer);<br>var cmd = events.srcElement.innerText= ="5"?true:false;<br>var i = parseInt(this.fObj.value,10);<br>var radix = parseInt(this.fObj.radix,10)-1;<br>if (i==radix&&cmd)<br> {<br>i = 0;<br>}<br>else if (i==0&&!cmd)<br>{<br>i = radix;<br>}<br>else<br>{<br>cmd?i++:i--;<br>}<br>this.fObj.value = this.formatTime(i);<br>this.fObj.select();<br>}<br>this.setTime = function(obj)<br>{<br>obj.value = this.formatTime(obj.value);<br>}<br>this.setFocusObj = function(obj)<br>{<br>eval(this.fName+"_up").disabled = eval(this.fName+"_down").disabled = false;<br>this.fObj = obj;<br>}<br>this.getTime = function() <br>{<br>var arrTime = new Array(2);<br>for (var i=0;i<document.getElementsByName(this.fName).length;i++)<br/>{<br/>arrTime[i] = document.getElementsByName(this.fName) )[i].value;<br/>}<br/>return arrTime.join(":");<br/>}<br/>}<br/><br>body {<br>background -color: #D4D0C8;<br>}<br>.c_fieldset {<br>padding: 0,10,5,10;<br>text-align: center;<br>width: 180px;<br>}<br>.c_legend {<br>font-family: Tahoma;<br>font -size: 11px;<br>padding-bottom: 5px;<br>}<br>.c_frameborder {<br>border-left: 2px inset #D4D0C8;<br>border-top: 2px inset #D4D0C8;<br>border-right: 2px inset #FFFFFF;<br>border -bottom: 2px インセット #FFFFFF;<br>background-color: #FFFFFF;<br>overflow: hidden;<br>font-family: "Tahoma";<br>font-size: 10px;<br>width:160px;<br>height:120px;<br>}<br> .c_frameborder td {<br>width: 23px;<br>height: 16px;<br>font-family: "Tahoma";<br>font-size: 11px;<br>text-align: center;<br>cursor: default;<br>}<br>.c_frameborder .selected { <br>背景色:#0A246A;<br>幅:12px;<br>高さ:12px;<br>色:白;<br>}<br>.c_frameborder スパン {<br>幅:12px;<br>高さ:12px;<br>}<br>.c_arrow {<br>幅: 16px ;<br>高さ: 8px;<br>font-family: "Webdings";<br>font-size: 7px;<br>line-height: 2px;<br>padding-left: 2px;<br>cursor: デフォルト;<br>}<br>.c_year {<br>font-ファミリー: "タホマ";<br>フォントサイズ: 11px;<br>カーソル: デフォルト;<br>幅:55px;<br>高さ:19px;<br>}<br>.c_month {<br>幅:75px;<br>高さ:20px;<br>フォント:11px "タホマ";<br>}<br>.c_dateHead {<br>background-color:#808080;<br>color:#D4D0C8;<br>}<br><br>//cloudchen 著、2004 /03/16<br>関数カレンダー(name,fName)<br>{<br>this.name = name;<br>this.fName = fName || "カレンダー";<br>this.year = new Date().getFull Year();<br>this.month = new Date().getMonth();<br>this.date = new Date().getDate();<br>//private <br>this.toString = function()<br>{<br>var str = "";<br>str += "<table border="0" cellpacing="3" cellpadding="0" onselectstart="return false">"; <br>str += "<tr>";<br/>str += "<td>";<br/>str += this.drawMonth();<br/>str += "</td>";<br/>str += "<td align=\"right\">";<br>str += this.drawYear();<br>str += "</td>";<br>str += "</tr>";<br>str += "<tr>";<br>str += "<td colspan=\"2\">";<br>str += "<div class=\"c_frameborder\">";<br>str += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"c_dateHead\">";<br>str += "<tr>";<br>str += "<td>日</td><td>一</td><td>二</td><td>三</td><td>四</td><td>五</td><td>六</td>";<br>str += "</tr>";<br>str += "</table>";<br>str += this.drawDate();<br>str += "</div>";<br>str += "</td>";<br>str += "</tr>";<br>str += "</table>";<br>return str;<br>}<br>//private<br> this.drawyear = function()<br>{<br>var str = "";<br>str += "<table border="0" cellpacing="0" cellpadding="0">";<br>str += "< tr>";<br>str += "<td>";<br/>str += "<input class="c_year" maxlength="4" value=""+this.year+"" name=""+this. fName+"" id=""+this.fName+"_year" readonly>";<br>//DateField<br>str += "<input type="hidden" name=""+this.fName+"" value=""+ this.date+"" id=""+this.fName+"_date">";<br>str += "</td>";<br/>str += "<td>";<br/>str += "< table cellpacing="2" cellpadding="0" border="0">";<br>str += "<tr>";<br>str += "<td><button class="c_arrow" onfocus= "this.blur()" onclick="event.cancelBubble=true;document.getElementById('"+this.fName+"_year').value++;"+this.name+".redrawDate()">5</button> ;</td>";<br>str += "</tr>";<br>str += "<tr>";<br>str += "<td><button class="c_arrow" onfocus= "this.blur()" onclick="event.cancelBubble=true;document.getElementById('"+this.fName+"_year').value--;"+this.name+".redrawDate()">6<; /button></td>";<br>str += "</tr>";<br>str += "</table>";<br>str += "</td>";<br>str += "</tr>";<br>str += "</table>";<br>return str;<br>}<br>//priavate<br>this.drawMonth = function()<br>{<br>var aMonthName = ["一","二","三","四","五","六","七","八","九","十","十一","十二"];<br>var str = "";<br>str += "<select class="c_month" name=""+this.fName+"" id=""+this.fName+"_month" onchange=""+this.name+".redrawDate() ">";<br>for (var i=0;i<aMonthName.length;i++) {<br/>str += "<option value=""+(i+1)+"" "+(i==this .month?"selected":"")+">"+aMonthName[i]+"月</option>";<br>}<br>str += "</select>";<br>return str;<br>} <br>//private<br>this.drawDate = function()<br>{<br>var str = "";<br>var fDay = new Date(this.year,this.month,1).getDay();<br>var fDate = 1-fDay ;<br>var lDay = 新しい日付(この年,この月+1,0).getDay();<br>var lDate = 新しい日付(この年,この月+1,0).getDate();<br> str += "<table border="0" cellpacing="0" cellpadding="0" id=""+this.fName+"_dateTable"+"">";<br>for (var i=1,j= fDate;i{<br>str += "<tr>";<br/>for (var k=0;k<7;k++)<br/>{<br/>str += "<td><span" +(j==this.date?" class="selected"":"")+" onclick=""+this.name+".redrawDate(this.innerText)">"+(isDate(j++))+ "</span></td>";<br>}<br>str += "</tr>";<br>}<br>str += "</table>";<br>return str;<br><br>function isDate( n)<br>{<br>return (n>=1&&n}<br>}<br>//public<br>this.redrawDate = function(d)<br>{<br>this.year = document.getElementById(this .fName+"_year").value;<br>this.month = document.getElementById(this.fName+"_month").value-1;<br>this.date = d || this.date;<br>document.getElementById(this.fName+"_year").value = this.year;<br>document.getElementById(this.fName+"_month").selectedIndex = this.month;<br>document.getElementById(this.fName+ "_date").value = this.date;<br>if (this.date>new Date(this.year,this.month+1,0).getDate()) this.date = new Date(this.year,this .month+1,0).getDate();<br>document.getElementById(this.fName+"_dateTable").outerHTML = this.drawDate();<br>}<br>//public<br>this.getDate = function(delimiter)<br>{ <br>if (!delimiter) delimiter = "/";<br>var aValue = [this.year,(this.month+1),this.date];<br>return aValue.join(delimiter);<br>}<br>}<br>< ;legend class="c_legend">日期(T)<br>var c = 新しいカレンダー("c");<br>ドキュメント。 write(c);<br>時間间(T)<br>var m = 新しい分("m");<br>m.play();<br>document.write(m);<br> td>4GetDate4GetTime