To use the Javascript is pretty straight forward. Firstly, there are two ways to use Javascript in your website.
1. Embed the Javascript codes in Html.
To embed the javascript codes, you just need to include a script tag into the html. See below example.
<script type="text/javascript"> alert("Hello from Javascript"); </script>
2. Use external file for javascript.
To use the external file, you can just include a full script path like below.
<script type="text/javascript" src="/js/javascriptFile.js"></script>
If you are using the second option which is external file, inside the javascriptFile.js, you do not need to include any javascript tag, which is <script type="text/javascript"></script>