Trouble changing innerHTML

Hi. I’m trying to recreate a Flash timer in HTML5/CSS/javascript and have got so far: http://gandalf458.co.uk/timers/

My second problem is that trying to set innerHTML isn’t working. I get TypeError: document.getElementById(…) is null on line 27 of timer.js - I’ve looked and looked but I can’t see what I’m doing wrong. Can anyone enlighten me please?

Thanks guys

Your script is in the wrong place. Almost all JavaScript goes just before the </body> tag. The only exceptions that go in the head are those where the script needs to finish running before the page starts to load (eg. framebreaker scripts and those to style the page differently when various JavaScript commands are or are not available).

Ah - thanks Felgall!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.