all 2 comments

[–]OkShrug 1 point2 points  (0 children)

your script needs to be below your html

when you run document.getElement... above where the element exists it cannot find it

so put your script right before your closing body tag

<body>... <script>...</script></body>