jQuery is an open-source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript. Elaborating the terms, jQuery simplifies HTML document traversing and manipulation, browser event handling, DOM animations, Ajax interactions, and cross-browser JavaScript development.
Why use jQuery?
jQuery helps us to do the following:
- It helps us to manipulate HTML and CSS
- It helps us to manipulate DOM (Document Object Model) elements
- Provides event methods to trigger and respond to events on an HTML page such as mouse click, keypress etc.
- Implements AJAX calls.
Using jQuery (JS) library on an HTML page: There are several ways to start using jQuery on your website.
- Use the Google-hosted/Microsoft-hosted content delivery network (CDN) to include a version of jQuery.
- Download your own version of jQuery from jQuery.com and host it on your own server or local filesystem.