This question already has an answer here:
I’m so so sorry asking this very repetitive question again, yet as I searched the previous answers I could not find any solutions. In the code below, my browser returns : Uncaught TypeError: Cannot set property ‘innerHTML’ of undefined as I click an the generated links. Would you be kind to help me out? Thank you very much in advance.
- 4 Answers 4
- Hot Network Questions
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
есть на вашей странице?
Без верстки трудно сказать.
Ошибка скорее всего заключается в том, что не удаётся найти элемент hours
Any help is appreciated!
4 Answers 4
You are not calling getElementById , you are attempting to index it. Since it is not an array and does not expose array-like behavior, the result is undefined . Replace your getElementById[spanId] with getElementById(spanId) .
 instead of () in document.getElementById(spanid) . getElementById is function, it has to be invoked with () and pass the parameter inside it.
Also missing () after getSeconds()
And now that you have this fixxed add this:
And you have an actual clock 😀
Hot Network Questions
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 4.0 with attribution required. rev 2019.11.15.35459