To include jQuery, we use a
<script> tag as follows:
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
In this example, the jQuery library is loaded from the jQuery content delivery network (CDN). A CDN is a collection of servers that can deliver content.
You must include the
crossorigin properties in the example ensure the file is delivered without any third-party manipulation.
<script> tag. We need to load the jQuery library before the main.js file. Otherwise, the computer will not understand the jQuery used in main.js.
Copy and paste the
<script> tag from the instructions above.
Navigate to index.html. Paste the copied tag on the line before the HTML loads main.js - found near the end of the HTML document.
We are using the minified version of jQuery from the jQuery CDN.