jQuery Introduction (original) (raw)

Last Updated : 26 Jul, 2024

**jQuery is an open-source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM). jQuery simplifies HTML document traversing and manipulation, browser event handling, DOM animations, Ajax interactions, and cross-browser JavaScript development.

Table of Content

The jQuery is the only library available today that meets the needs of both designer types and programmer types. jQuery is widely famous for its philosophy of ****"Write less, do more."** This philosophy can be further elaborated as three concepts:

How to Add jQuery to HTML Page?

There are two methods to use jQuery in your HTML page.

The easiest method to include jQuery in your HTML page is by using a CDN link. CDN links hosted the jQuery files to the servers that can be easily used without downloading the files.

Include jQuery CDN link to the HTML page using

`

2. Download the jQuery Files Locally and use Them

Visit the jQuery Official Website and download the latest version of jQuery. Then include the downloaded jQuery file into your project. Place the _jquery.min.js file in a directory within your project, such as js/. Next, use

Hello, World!

<button id="hideButton">
    Hide Message
</button>

<!-- jQuery Script -->
<script>
    $(document).ready(function() {
        $('#hideButton').click(function() {
            $('#message').hide();
        });
    });
</script>

`

**Output:

jQuery-Basic-Example

**Why jQuery?

Some of the key points which support the answer for why to use jQuery:

**Advantages of Using jQuery in a Project

**Disadvantages of Using jQuery in a Project