代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
setInterval(attime,1000);
function attime(){
var time=new Date();
i=time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
document.getElementById("showtime").value=i;
}
setInterval(attime,1000);
function attime2(){
var time2=new Date();
i=time2.getHours()+":"+time2.getMinutes()+":"+time2.getSeconds();
document.getElementById("showtime2").value=i;
}
</script>
</head>
<body>
现在时间是:<input type="text" size="40" id="showtime" />
现在时间是:<input type="text" size="40" id="showtime2" />
</body>
</html>
运算后为什么,第二个input没有显示任何东西,是被跳过了吗?还望大神指教
凨亦凌