What does the $ symbol mean in jQuery?
Updated May 14, 2026
Short answer
The $ symbol is an alias for the jQuery function and is commonly used to select DOM elements and access jQuery functionality.
Deep explanation
In jQuery, the $ symbol is simply a shorthand reference to the global jQuery object. Instead of writing 'jQuery()', developers can write '$()' for brevity.
The $ function performs several roles:
- DOM element selection
- DOM-ready execution
- Utility method access
- AJAX operations
- Wrapping DOM elements into jQuery objects
Internally, jQuery returns a jQuery object containing selected DOM elements along with methods attached to its prototype.
Example:
- $('#id') selects an element by ID
- $('.class') selects elements by class
- $('div') selects all div elements
In environments where another library also uses $, jQuery provides noConflict() mode to avoid namespace collisions.
Real-world example
In large applications with many DOM interactions, developers use $ extensively to simplify syntax and improve readability. For example, dynamic dashboards often use selectors like $('.card') or $('#submitBtn').
Common mistakes
- Assuming $ always refers to jQuery. In projects using multiple libraries such as Prototype.js, the $ symbol may conflict unless noConflict() is used.
Follow-up questions
- What does jQuery.noConflict() do?
- Can jQuery work without the $ symbol?
- What type of object does $() return?