jQuery is a free, open-source JavaScript library maintained by the jQuery Foundation that simplifies DOM manipulation, event handling, and AJAX requests. It's still reported in roughly 23.4% of developer surveys, the #3 most-used web technology, because it powers a massive share of older and legacy sites. It rose to dominance in the 2010s by smoothing over inconsistent browser APIs with one simple, chainable syntax โ though most new projects today reach for React or plain modern JavaScript instead.
jQuery's $.get shorthand fetches data and updates the page in just a few chained lines.
$('#load-btn').on('click', function() {
$.get('/api/user/42', function(data) {
$('#username').text(data.name);
$('#user-card').fadeIn();
}).fail(function() {
$('#error').text('Could not load user').show();
});
});
jQuery needs no build step โ drop it into a page via a script tag (CDN) or install it through npm for bundled projects.
<!-- CDN: drop straight into an HTML page -->
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
# or install via npm for a bundled project
npm install jquery