Hi,
I'm using the javascript to display the clock in my asp.net page. The script is given below:
<script type="text/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 numbers<10
m=checkTime(m)
s=checkTime(s)
document.getElementById('dtime').innerHTML=h+":"+m +":"+s
t=setTimeout('startTime()',500)
}
function checkTime(i)
{
if (i<10)
{i="0" + i}
return i
}
</script>
I am calling the function on the body load event and providing the element to the table dimension (<td id="dtime">).
And I tried the element as div also(<div id="dtime">) but it is giving the nativecode writeups over there means the following is displayed in the div or td
function getHours() { [native code] } : function getMinutes() { [native code] } : function getSeconds() { [native code] }
And I tried to convert it into text and write over there still it is not displaying the clock. If anybody knows how to eliminate the native code write ups
Tnx n Regards
Thanks and Regards,
Senthil Kumar M.
[email protected]
http://www.leanlearn.tk