jQuery Properties

Beginner
⏱️ 8 min read
📚 Updated: Jul 2026
🎯 4 Tutorials
Read-only metadata

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.

01

.length

Match count

02

.context

Search root

03

$.ready

DOM signal

04

Read-only

No ()

05

Legacy

1.x / 2.x

06

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:

$("li").length → property (number of matches) $("li", "#menu").context → legacy property (removed jQuery 3.0) $("li", "#menu") → method-style call with context argument (still supported)

Properties Tutorial Index

Search by property name or browse by category. Each tutorial includes syntax, five try-it examples, and FAQs.

Collection Properties

4 tutorials

Read-only metadata on jQuery object instances — length, selector, and context.

PropertyDescriptionTutorial
.contextDOM node passed to jQuery() when the collection was created — usually document; removed in jQuery 3.0; used by legacy .live() delegation.Open
.selectorOriginal CSS selector string passed to jQuery() at creation — unreliable after traversal; deprecated 1.7, removed 3.0; pass selector explicitly in plugins.Open
.jqueryVersion 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
.lengthNumber 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

Properties are read-only values on jQuery collections or the global jQuery namespace — unlike methods, you access them without parentheses. Examples include .length on a selection, jQuery.fn.jquery for the version string, and legacy .context for the DOM search root.
Methods are functions you invoke: $("p").hide(). Properties are fields you read: $("p").length returns a number. Some global values like jQuery.ready are thenable objects with .then(), but they are still accessed as properties, not called like hide().
Notable removals include .context and .selector on collections — internal metadata that plugins sometimes misused. The second argument to jQuery(selector, context) still works; only reading .context back from the set was removed.
Begin with .context if you maintain jQuery 1.x code or wonder about scoped $(selector, container) searches. For modern projects, focus on .length, jQuery.fn.jquery, and namespace properties like jQuery.ready documented in the DOM and Utilities sections.
Yes — every jQuery object has .length (match count). Legacy properties like .context existed only through jQuery 2.x. Global properties such as jQuery.support live on the jQuery function itself.
The jQuery documentation groups read-only fields under Properties — collection fields (.context, .length, .selector) and namespace fields (jQuery.ready, jQuery.support, jQuery.browser). This hub collects CodeToFun tutorials for that category.

Continue to .context Property

Learn the DOM search root metadata — scoped selection and modern replacements.

.context tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful