I could not understand why this JS does not work for an element at the end of the html
I checked that this element has almost the same html structure as the other ones (for which my JS works). Could you please elaborate on this issue? cambridge.zip (35.3 KB)
I have not learned JavaScript yet(maybe never will). It seems like the scripts are being executed while the DOM is not ready. To prevent that, you can put script tag(s) at the end of html file, or simply mark them as async.