代碼如下:<!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>無(wú)標(biāo)題文檔</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>現(xiàn)在時(shí)間是:<input type="text" size="40" id="showtime" />現(xiàn)在時(shí)間是:<input type="text" size="40" id="showtime2" /></body></html>運(yùn)算后為什么,第二個(gè)input沒(méi)有顯示任何東西,是被跳過(guò)了嗎?還望大神指教
關(guān)于setInterval()的一個(gè)小問(wèn)題
天瑜CJT
2014-07-19 13:20:02