What is jQuery?

Get a brief introduction to jQuery and its features.

jQuery is a lightweight JavaScript library designed to update web pages on the fly. It is the most popular JavaScript library, used by around 70 million websites worldwide. The jQuery motto is “write less, do more”, because it reduces many lines of raw JavaScript code into a single line with its simple interface.

svg viewer

Features of jQuery

Following are the core concepts and features of jQuery:

  • Event Handling
  • DOM Manipulation
  • Animations and Effects
  • AJAX framework

Including jQuery in webpages

To utilize jQuery functionality, we need to include the jQuery library in our web pages. Add jQuery to a webpage by placing the script tag inside the head tag with the src of the script tag pointing towards the jQuery library, as shown below.

<head>
   <script src="link-to-library"> </script>  
</head>

The production release of the jQuery library can be downloaded from jQuery’s website into your website creation folder. You can then load the library by referencing the local copy of jQuery’s library as follows:

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

Alternatively, you can link to the jQuery library on one of the CDNs like this:

<head>
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"> </script>  
</head>

📝 Note: You can learn more about both of these methods here.