What is jQuery?
jQuery is a fast, small, and feature-rich JavaScript library. It simplifies things like HTML document traversal and manipulation, event handling, animation, and Ajax with an easy-to-use API that works across a multitude of browsers.
jQuery was released in January 2006 by John Resig. It quickly gained popularity because it helped developers write less code to achieve more functionality. Over time, jQuery became the most widely used JavaScript library in the world.
- DOM manipulation and traversal
- Event handling with less code
- Effects and animations
- AJAX support
- Cross-browser compatibility
- Extensibility through plugins
While JavaScript provides core functionality, jQuery makes it easier and faster to write cross-browser compatible code. For example, selecting elements and adding event listeners is more concise in jQuery:
// JavaScript
document.getElementById("btn").addEventListener("click", function() {
alert("Clicked!");
});
// jQuery
$("#btn").click(function() {
alert("Clicked!");
});
You can include jQuery in your HTML using a CDN:
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
The basic jQuery syntax is:
$(selector).action();
Example:
$(document).ready(function() {
$("p").click(function() {
$(this).hide();
});
});
With modern browsers supporting most JavaScript features and the rise of frameworks like React and Vue, jQuery is less critical today. However, it is still useful for legacy systems, quick projects, or when working with older browser support.


