To include a script, the opening script tag needs a src attribute.

<html>
<body>
  HTML code goes here
  <script>console.log("JavaScript goes here");</script>
</body>
</html>]]>

Make sure to add src="script.js".