JQuery connection

In this time I’m learning JQuery topic. How to connect JQuery to html doc in Atom for separate file?
Thanks.

Option 1:
You download jquery.js from here (select “Download the uncompressed, development jQuery 3.1.0”) and add path to it in your index.html's <head> or before the </body> tag:


  <head>
  <script src="path/to/jquery-3.1.0.min.js"></script>
  </head>
  ...
  ...

or

  <body>
  ...
  ...
  <script src="path/to/jquery-3.1.0.min.js"></script>
  </body>

Option 2:
You add link to jQuery’s CDN in your index.html's <head> tag:

<html>
  <head>
  <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
  </head>
...
...

How to connect my file js to html than I add this link?

You add another <script> tag:

<script src="path/to/jquery-3.1.0.min.js"></script>
<script src="path/to/your.js"></script>

Ok. Thank you.:slight_smile: