function timeClock()
{
setTimeout("timeClock()", 1000);
now = new Date();
alert(now);
f_date = now.getDate()+" "+strMonth(now.getMonth())+" "+now.getFullYear()+"/"+timeFormat(now.getHours(), now.getMinutes());
return f_date;
}
<span class="foo"><script type="text/javascript">document.write(timeClock());</script></span>
अलर्ट (अब); मुझे हर सेकेंड का मूल्य देता है लेकिन यह एचटीएमएल में अपडेट नहीं होता है। मैं पृष्ठ को रीफ्रेश किए बिना HTML पर समय कैसे अपडेट कर सकता हूं?नियमित रूप से समय कैसे अपडेट करें?
आईवो - अच्छा दुःख आदमी , मुझे यकीन है कि आप कठोर होने के बिना अपना समाधान दे सकते थे। कोई भी गलतियों के बिना है: "फिर" -> "से"? आ जाओ भाई। – d2burke
आपको शायद प्रमुख शून्य के साथ 'now.getMinutes()' कॉल को पैड करना चाहिए। –