+ 1
Why it's not working
2 Respostas
+ 2
Just wrap your whole JS code in -
window.onload = () => {
...
}
+ 1
You are selecting element before thay are rendered on screen, so nothing heppend (not sure why error dont exist)
So place your code inside script at bottom of page, or use window.onload.
Here is some example of window.onload in action, you can also wrap your full javascript code and it will work
https://code.sololearn.com/WH0xv85NMI89/?ref=app