I\'ve looked at the other answers but still don\'t understand.
For some reason this line of code always returns null.
var els = document.querySelecto
I doubt your JS gets loaded before the markup and css. In that case, you could try using
The contents are loaded first and your java script should work fine after that.