jQuery - Get Started

Learn, what is jQuery, how to set it up, how to work with it, etc.
Submitted by Pratishtha Saxena, on August 30, 2022

What is jQuery?

jQuery is a JavaScript library used to simplify HTML DOM tree traversal and manipulation, and event handling. It is free, open-source software. It is user-friendly and easy to use. When JavaScript has been used on the website, then jQuery is also preferred as it is a very lightweight language and it makes it much easier to work with JavaScript. It also simplifies AJAX and DOM manipulations.

JavaScript has many libraries other than jQuery, but this is the most used and popular among all.

How to add jQuery to your webpages?

Let's see how to set up jQuery on your device. There are two ways for working with jQuery:

  1. Downloading jQuery
  2. Using CDN Link

1) Downloading jQuery

jQuery can be downloaded from jQuery.com which is its official website. https://jquery.com/download/

There have been various versions of jQuery, but the latest version (3.6.1) will be available on the website. Other than this, there are two types of jQuery files present – compressed (production), and uncompressed (development). The compressed one is for live projects and websites, whereas the uncompressed one is generally for development and testing. You can download it according to your need.

Make sure that the jQuery file downloaded should be in the same folder/directory as the HTML pages. Once downloaded and placed successfully, jQuery now can be used by just defining the script tag (<script>...</script>) in the <head> tag and mentioning the source link of jQuery over there.

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

2) Using CDN Link

The other method is a simple technique of using jQuery online without downloading it. For this a CDN (Contact Delivery Network) link has to be included in the same way as above.

CDN link is provided below:

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

Generally, using CDN link for jQuery has resulted in faster loading of the websites, but any of the above methods can be used according to the need.

References:




All jQuery Examples

Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.