No repeat Timestamp display

0 Jermaine Walker · November 16, 2015
I have been following your tutorial and have enjoyed every minute but this area I seem to be running into a problem.

I am using Notepad++  windows 10  firefox browser:
I followed your script but when I call it  the browser only displays one time stamp. Can you tell me what I am doing wrong.  Its driving me crazy as I have spent a hr trying figure out what my problem!!!

function printTime() {
  var now = new Date();
  var hours = now.getHours();
  var mins = now.getMinutes();
  var seconds = now.getSeconds();
  document.write(hours + ':' + mins + ':' + seconds + '<br />');
setInterval('printTime()', 1000);

Post a Reply


Oldest  Newest  Rating
0 Jermaine Walker · November 29, 2015
ok thanks
  • 1



A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.