jQuery Get Started


Adding jQuery to Your Web Pages

To begin using jQuery on your website, you have various options. You can:

  • Get the jQuery library from jQuery.com.
  • Get jQuery from a CDN, such as Google.

Downloading jQuery

There are two versions of jQuery that you can download:

  • The production version is for your live website. It's compressed and made smaller, so it runs smoothly.
  • The development version is meant for testing and development purposes. It contains uncompressed and readable code.

You can get both versions by clicking on this link jQuery.com.

The jQuery library is just one file written in JavaScript. You include it in your HTML using the <script> tag. Remember to place the </script> tag inside the <head> section of your HTML document./p>

<head>
<script src="jquery-3.7.1.min.js"></script>
</head>

Tip: Put the file you downloaded in the folder with the pages where you want to use it.


jQuery CDN

If you don't want to download and host jQuery on your own, you can use it from a CDN (Content Delivery Network).

Google offers a platform for hosting jQuery.

The hosted jQuery from Google offers a major benefit:

A lot of people have already gotten jQuery from Google while visiting other websites. So, when they come to your site, it's already stored in their computer's memory, making your site load faster. Additionally, most Content Delivery Networks (CDNs) ensure that when a user needs a file, it's provided from a server nearby, making the loading time even quicker.