SyntaxStudy
Sign Up
jQuery What is jQuery?
jQuery Beginner 5 min read

What is jQuery?

What is jQuery?

jQuery is a fast, small, feature-rich JavaScript library that simplifies HTML manipulation, event handling, animation, and AJAX with an easy-to-use API across browsers.

Why jQuery?

  • Write less, do more
  • Cross-browser compatible
  • Huge ecosystem of plugins
  • Still widely used in legacy projects

Adding jQuery

<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>

Document Ready

$(document).ready(function() {
    console.log("DOM is ready");
});

// Shorthand
$(function() {
    console.log("Also ready");
});

First Example

$(function() {
    $("button").click(function() {
        $("p").text("Hello jQuery!");
    });
});
Pro Tip

Modern JavaScript (ES6+) covers most jQuery use cases natively — use jQuery when working with legacy codebases.