日期:2014-05-17  浏览次数:20701 次

如何在<td>标签里面调用javascript动态显示信息
我是想在现在时间那里显示当前系统时间,如何在<td>里面调用javascript?

<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="css/admin.css" type="text/css" rel="stylesheet">
<script language="javascript"> 
function startTime() 

var today=new Date(); 
var h=today.getHours(); 
var m=today.getMinutes(); 
var s=today.getSeconds(); 
//add a zero in front of number<10 
m=checkTime(m); 
s=checkTime(s); 
document.getElementById('txt').innerHTML="现在的时间是"+h+":"+m+":"+s; 
t=setTimeout('startTime()',1000); 

function checkTime(i) 

if (i<10) 

i="0"+i; 

return i; 

</script>
</HEAD>
<BODY>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
  <TR height=28>
  <TD background=images/title_bg1.jpg>当前位置: </TD></TR>
  <TR>
  <TD bgColor=#b1ceef height=1></TD></TR>
  <TR height=20>
  <TD background=images/shadow_bg.jpg></TD></TR></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
  <TR height=100>
  <TD align=middle width=100><IMG height=100 src="images/admin_p.gif" 
  width=90></TD>
  <TD width=60>&nbsp;</TD>
  <TD>
  <TABLE height=100 cellSpacing=0 cellPadding=0 width="100%" border=0>
   
  <TR>
  <TD>当前时间:<a onload="startTime()"></a></TD></TR>
  <TR>
  <TD style="FONT-WEIGHT: bold; FONT-SIZE: 16px">admin</TD></TR>
  <TR>
  <TD>欢迎进入网站管理中心!</TD></TR></TABLE></TD></TR>
  <TR>
  <TD colSpan=3 height=10></TD></TR></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="95%" align=center border=0>
  <TR height=20>
  <TD></TD></TR>
  <TR height=22>
  <TD style="PADDING-LEFT: 20px; FONT-WEIGHT: bold; COLOR: #ffffff" 
  align=middle background=images/title_bg2.jpg>您的相关信息</TD></TR>
  <TR bgColor=#ecf4fc height=12>
  <TD></TD></TR>
  <TR height=20>
  <TD></TD></TR></TABLE>
<TABLE cellSpacing=0 cellPadding=2 width="95%" align=center border=0>
  <TR>
  <TD align=right width=100>登陆帐号:</TD>
  <TD style="COLOR: #880000">admin</TD></TR>
  <TR>
  <TD align=right>真实姓名:</TD>
  <TD style="COLOR: #880000">admin</TD></TR>
  <TR>
  <TD align=right>上线时间:</TD>
  <TD style="COLOR: #880000">onload="startTime()"</TD></TR>
  <TR>
  <TD align=right>IP地址:</TD>
  <TD style="COLOR: #880000">10.89.33.1</TD></TR>
</TABLE></BODY></HTML>

------解决方案--------------------<