html(javascript)

来源:百度知道 编辑:UC知道 时间:2024/06/14 04:29:07
在htm上显示一个,时间牌,显示当前日期及时间,要求时间不断以秒为单位进行变化(时钟效果)

钟表样式的我不会,我会简单数字显示的:
<html>
<head>
<script language="javascript">
function time()
{
var now=new Date();
var hour=now.getHours();
document.myform.mytext.value=("今天是"+now.getYear()+"年"+(now.getMonth()+1)+"月"+now.getDate()+"日"+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+" ");
setTimeout("time()",1000);
}
</script>
</head>
<body onload="time()" >
<form name="myform" >
<input type="text" name="mytext" size="30" style="border:none;" />
</form>
</body>
</html>

文件: test.htm
<applet code="Clock.class" width=400 height=300>
<param name=bgcolor value="ffffff">
<param name=fgcolor1 value="ff0000">
<param na