# jQuery — Fast Small Feature-Rich JavaScript Library > jQuery simplifies HTML document traversal, event handling, animation, and Ajax with an easy-to-use API that works across browsers. ## Install Save as a script file and run: # jQuery — Fast Small Feature-Rich JavaScript Library ## Quick Use ```bash npm install jquery ``` ```html ``` ## Introduction jQuery changed how millions of developers write JavaScript by providing a concise, cross-browser API for DOM manipulation, events, and Ajax. Released in 2006, it remains one of the most widely deployed JavaScript libraries on the web, powering a significant share of all websites. ## What jQuery Does - Simplifies DOM traversal and manipulation with CSS-style selectors - Provides cross-browser event handling without compatibility hacks - Wraps XMLHttpRequest into clean Ajax helpers like `$.get()` and `$.post()` - Ships with built-in animation and effects such as `fadeIn()`, `slideUp()`, and `animate()` - Supports a massive plugin ecosystem for date pickers, carousels, validation, and more ## Architecture Overview jQuery exposes a single global `$` function that wraps native DOM elements into jQuery objects. Internally it uses Sizzle (now merged into core) as its CSS selector engine. Methods are chainable, returning the jQuery set so developers can compose operations fluently. The library handles browser inconsistencies behind the scenes by feature-detecting and patching behavior at load time. ## Self-Hosting & Configuration - Install via npm (`npm install jquery`) or download from the official CDN - Use the slim build (`jquery.slim.min.js`) to exclude Ajax and effects if unused - Import as an ES module: `import $ from 'jquery'` - Pair with a bundler like Webpack or Vite for tree-shaking unused utilities - No configuration file needed; the library is ready to use on load ## Key Features - 30 KB minified+gzipped slim build for fast page loads - Fluent chainable API that reduces boilerplate code - Built-in Deferred/Promise support for asynchronous workflows - Battle-tested across every major browser including legacy IE support - Over 15 years of plugins, tutorials, and community knowledge ## Comparison with Similar Tools - **Vanilla JS** — no dependency but requires more boilerplate for cross-browser consistency - **Alpine.js** — declarative in-HTML reactivity; jQuery is imperative and selector-driven - **React / Vue** — component-based with virtual DOM; jQuery manipulates the real DOM directly - **htmx** — extends HTML with Ajax attributes; jQuery needs explicit scripting - **Cash / Zepto** — smaller jQuery-compatible alternatives with fewer features ## FAQ **Q: Is jQuery still relevant in 2025?** A: Yes. Over 75% of websites with JavaScript still use jQuery, and it continues to receive maintenance releases. It remains a pragmatic choice for server-rendered pages and progressive enhancement. **Q: Can I use jQuery with React or Vue?** A: Technically yes, but mixing direct DOM manipulation with a virtual-DOM framework causes conflicts. Prefer the framework's own APIs. **Q: How large is jQuery?** A: The slim minified+gzipped build is about 30 KB. The full build with Ajax and effects is around 90 KB. **Q: Does jQuery support TypeScript?** A: Type definitions are available via `@types/jquery` on npm, providing full IntelliSense in TypeScript projects. ## Sources - https://github.com/jquery/jquery - https://jquery.com - https://api.jquery.com --- Source: https://tokrepo.com/en/workflows/46d808fd-44b2-11f1-9bc6-00163e2b0d79 Author: Script Depot