In Repl.it, you need to change the following line: <script src="script.js"> need to change to <script type="text/javascript">