This code works like charm on my browser as it should work
Code:<html> <script language=javascript> function change() { var da=new Date(); document.getElementById("date").innerHTML=da; setTimeout("change()",1000); } </script> <body onLoad = "change()"> <div id="date"></div> </body> </html>
but when i change the code to this no change in time and date
as per my c lanuage experience the function change keeps calling itself creating a sort of infinite loop and keep updating date but it is not happening;Code:<html> <script language=javascript> function change() { var da=new Date(); document.getElementById("date").innerHTML=da; change(); } </script> <body onLoad = "change()"> <div id="date"></div> </body> </html>



Reply With Quote
Bookmarks