jQuery Properties
What You’ll Learn
jQuery properties are read-only fields — not functions. Collection properties describe the current set (.length, legacy .context). Namespace properties live on the global jQuery object (jQuery.ready, jQuery.support). This hub indexes 4 property tutorials with full examples and try-it labs.
.length
Match count
.context
Search root
$.ready
DOM signal
Read-only
No ()
Legacy
1.x / 2.x
3.0
Some removed
Introduction
Most jQuery tutorials focus on methods — chainable functions like .hide(), .on(), and .addClass(). Properties are different: you read them like object fields.
When you run $("li"), jQuery returns a collection object. That object always exposes .length — how many elements matched. In older jQuery versions it also stored .context, the DOM node that limited the search when you used the two-argument form $(selector, context).
Some properties belong to the global jQuery namespace instead of each collection. Those are documented in other CodeToFun sections too — for example jQuery.ready in DOM and jQuery.support in Utilities. This hub focuses on the official Properties category collection tutorials.
👀 Property vs Method vs Second Argument
Three related ideas beginners often mix up:
Properties Tutorial Index
Search by property name or browse by category. Each tutorial includes syntax, five try-it examples, and FAQs.
Collection Properties
4 tutorialsRead-only metadata on jQuery object instances — length, selector, and context.
| Property | Description | Tutorial |
|---|---|---|
.context | DOM node passed to jQuery() when the collection was created — usually document; removed in jQuery 3.0; used by legacy .live() delegation. | Open |
.selector | Original CSS selector string passed to jQuery() at creation — unreliable after traversal; deprecated 1.7, removed 3.0; pass selector explicitly in plugins. | Open |
.jquery | Version string on jQuery.fn — every collection inherits it; read with $.fn.jquery; truthy check detects jQuery objects; since jQuery 1.0, still in 3.x. | Open |
.length | Number of DOM elements in the collection — 0 when nothing matched; updates after filter and add; use instead of removed .size(); since jQuery 1.0. | Open |
❓ Frequently Asked Questions
Continue to .context Property
Learn the DOM search root metadata — scoped selection and modern replacements.
6 people found this page helpful
