I had the script in the <head> before, so it ran before the elements it was looking for existed in the DOM. Moving before the closing </body> tag to fix (and including a belt-and-braces check for the existence of the element before trying to change its style).
I had the script in the
<head>
before, so it ran before the elements it was looking for existed in the DOM. Moving before the closing</body>
tag to fix (and including a belt-and-braces check for the existence of the element before trying to change its style).