External javascript file declaration in <body> not working

Thanks for the code display instruction!

I was wondering about this in the back of my mind but I finally got frustrated and desperate enough to test it out.
On page 105 the text talks about the need to “tell the HTML to run the Javascript.” The narrative then goes on to give the following example:

             </div>
          </div>
       </main>
     <script src="scripts/main.js" charset="utf-8"></script>
  </body>
</html>

And the above is what I had in my code. I tried adding “debugger” to the Javascript file in a few places in order to step thru the code and see why it wasn’t executing the “event.preventDefault();” command only to come to the realization that the Javascript file was never even being executed. This got me really scratching my head for a while until I remembered actually seeing another piece of the command in other pages I had looked at that told the browser the type of script it would be dealing with as in:

<script type="text/javascript"....

I then added the "type"statement to the full command as in:

             </div>
          </div>
       </main>
     <script  type="text/javascript" src="scripts/main.js" charset="utf-8"></script>
  </body>
</html>

The result of this change was that the Javascript file was read and executed and the web page operated as expected.

I am running this version of Chrome - Version 56.0.2924.87 (64-bit) - it says it is the latest. All I know is that Chrome seems to require the additional piece of the command which is not included in the book.

Thanks for your help.