- There is no installation required to use jQuery.
- We just need to place it on our site in a directory.
- Whenever we need a page to have jQuery available, we will simply refer to the file's location from the HTML document.
How to install jQuery
We can install jQuery in our application in two ways:
- By downloading: The official jQuery website (https://jquery.com/) is always the most up-to-date resource for code and news related to the library.
- By using CDN: CDN stands for Content delivery network. We can include jQuery from CDN directly without downloading any source code.
1 By downloading:
Follow the given steps to include the jQuery library in your webpage.
Step 1 Go to https://jquery.com/ and download the latest version of the library.
Step 2 Create a js folder and save the file in it to use.
Step 3 Create an HTML file install.html and put the given code there.
<h1>This code is replaced.</h1>
Step 4 Open the document in the browser to see the result.
2 By using CDN:
Google and Microsoft provide CDN support for the latest version.
Here we are using Google CDN.