Trying to make a simple digital clock, running into a DOM problem
https://code.sololearn.com/Wqpt5i7YgYi2/#js I've been trying to do some basic exercises to cement the knowledge gained from the fundamental courses and the digital clock is doing my head in. I can get a functional basic clock going with the bare minimum of JS, but the above keeps running into a DOM problem. The error is: TypeError: document.getElementById(...) is null Googling has led me down a few paths, which I've document as comments in the HTML section as I attempted them, but so far I can't get the order right to make it load and run properly. I've gotten to the point that I understand that it's a problem with the code calling for an element that doesn't exist yet, so I know that is what I have to fix, but I can't figure out how to make that happen. I think I could get it working if I move the entire JS section into a script inside the HTML below the div, because then the order should be good, but I'd like to get it working in the current construction rather than cutting and pasting half the code (If it's at all possible). If someone could help me figure out where I'm going wrong I would greatly appreciate it!