How to add jQuery to a JavaScript file?

To add jQuery to a JavaScript file, add a script to the head tag of your HTML.

Here's the script tag, that you need to add:

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

Where to add it?

Add it to the head tag of your HTML before your own JavaScript file:

<html>
  <head>
    ...
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="Your_JavaScript_File.js"></script>
    ...
  </head>
  <body>
    ...
  </body>
</html>