为什么要在 input 里面显示时间呢?难道你要把这时间数据提交吗?
如果不需要,就用 <div> 或者 <span> 吧。比如:
<div id="divTime"></div><script>
...
divTime.innerHTML = timeValue
</script>
如果不需要,就用 <div> 或者 <span> 吧。比如:
<div id="divTime"></div><script>
...
divTime.innerHTML = timeValue
</script>
解决方案 »
- 求教,希望得到一个JS大神的指教。
- js数组,元素交换(第三弹)
- php登陆框 怎样记住用户名 希望尽早得到答复 谢谢
- 求一个正则表达式校验字符串格式:xxx.xx
- jquery纵向菜单的问题
- javascript插入表情,像QQ那样的,如何实现?
- 请教下window的这个属性--ONREQUEST
- 如何把div2的高度付给div1
- 已经有了一段纯HTML脚本(整个BODY ),怎么在已有的页面动态的显示出来, 我不想单独生成HTML文件
- 请问MS的Jscript的参考,下载后安装后,怎么使用啊?
- ShowModalDialog在第二次被调用时,显示的url为什么没有刷新?如何才能刷新?
- 如何给页面中input type=file加上过滤属性,比如说让它只能浏览HTM文件?
var timerID = null
var timerRunning = false
function MakeArray(size)
{
this.length = size;
for(var i = 1; i <= size; i++)
{
this[i] = "";
}
return this;
}
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false
}
function showtime () {
var now = new Date();
var year = now.getYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var day = now.getDay();
Day = new MakeArray(7);
Day[0]="Sonntag";
Day[1]="Montag";
Day[2]="Dienstag";
Day[3]="Mittwoch";
Day[4]="Donnerstag";
Day[5]="Freitag";
Day[6]="Samstag";
var timeValue = "";
timeValue +='Die Statistiken wurden am '+ (Day[day]) + ", ";
timeValue += 'den '+date + ".";
timeValue += month + "." + year + " ";
timeValue +='um '+ ((hours <= 12) ? hours : hours);
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += ((seconds < 10) ? ":0" : ":") + seconds+' zuletzt aktualisiert';
// timeValue += (hours < 12) ? " Guten Morgen" : " Guten Tag";
document.jsfrm.face.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true
}
function startclock () {
stopclock();
showtime() }
</script><div align="left"><table width="95%">
<tr>
<td align="left" width="33%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF"><form name="jsfrm">
<p align="left"><input type="text" size="200" name="face" style="font-family: Arial; border-style: solid; border-color: #FFFFFF">
</p>
</form>
</td>
</tr>
</table>
</div>
<tr>
<td align="left" width="33%" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF"><form name="jsfrm">
<p align="left"><input type="text" size="200" name="face" style="font-family: Arial; border-style: solid; border-width: 0px;border-color: #FFFFFF">........