JavaScript code must be placed in the <head> section of the document. code example
Example: include script in html
<script type="text/javascript" src="/path/to/script.js"></script>
<script type="text/javascript" src="/path/to/script.js"></script>