.prop() (since 1.6) gets or sets live DOM properties on matched elements — runtime state like checked, disabled, and selectedIndex.
Remember
// Get (first element only)
var on = $("input").prop("checked");
// Set boolean state
$("input").prop("checked", true);
$("input").prop("disabled", false);
// Prefer .val() for typed text
$("input").val("someValue");
Same overload shapes as .attr(), but for properties.
Select the element(s).
Get: .prop("checked") — first match only.
Set one: .prop("disabled", true) — every match.
Set many: pass a plain object of property/value pairs.
Compute: .prop("checked", function (i, val) { return !val; }).
Signature
Since
Role
.prop(name)
1.6
Get property on first element
.prop(name, value)
1.6
Set property on every match
.prop({ … })
1.6
Set several properties at once
.prop(name, fn)
1.6
Set from function(index, oldValue)
Pseudocode
Pseudocode
if called as .prop(name):
return property name on first matched element
// undefined if unset or empty selection
if called as .prop(name, value):
for each matched element:
set property name = value
if called as .prop(object):
for each key in object:
set that property on every matched element
if called as .prop(name, fn):
for each matched element with index i:
next = fn(i, currentProperty)
if next is not undefined: set property to next
Reference
Cheat Sheet
Keep these facts handy for form and boolean state.
Initially checked:
attr: checked | prop: true | :checked: true
After uncheck: prop and :checked become false;
attr still reflects the initial attribute.
How It Works
Listen. Update the readout on every change.
attr. Initial markup attribute — does not track clicks.
prop. Live boolean state of the checkbox.
:checked. Selector form of the same live test.
Example 2 — Set checked
Turn a checkbox on with a boolean property setter.
Property-only.selectedIndex has no HTML attribute twin.
Set..prop("selectedIndex", 2) picks the third option.
Read. Confirm with the getter.
Value. Use .val() when you care about the option value string.
Edge Cases & Pitfalls
These trips up beginners most often.
boolean
Attribute ≠ live checked state
Use .prop("checked") or .is(":checked"). The attribute stays at the initial default.
remove
Never .removeProp() natives
Reset with .prop(name, false). .removeProp() is only for custom properties you added.
value
Prefer .val() for typed text
.prop("value") can work, but .val() is the dedicated, consistent API for form values.
property-only
Some names are properties only
selectedIndex, tagName, nodeType, and similar must use .prop() — not .attr().
Compatibility
Browser Support
.prop() was added in jQuery 1.6 to separate properties from attributes. Works wherever your loaded jQuery 1.6+ build runs.
✓ Stable · jQuery 1.6+
jQuery .prop()
Universal across browsers that run your jQuery version. Prefer current jQuery 3.x+ for consistent property handling.
100%jQuery core
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
.prop()Universal
Bottom line: Safe for everyday apps. Use .prop() for live form and DOM state; keep .attr() for markup attributes.
Analysis
Performance Notes
Approach
Cost
Best for
One .prop() get/set
Cheap
Typical form wiring
Object / callback on a set
Cheap
Batch updates without re-querying
Huge loops with fresh selectors
Costly
Cache the selection once
Property access is inexpensive. Prefer one selection plus a callback or object setter over repeated queries in tight loops.
Remember
Key Takeaways
Role: get/set live DOM properties since jQuery 1.6.
vs attr: properties are runtime state; attributes are markup.
Forms: name/value, object, or callback — getters are first-only.
Reset:.prop(name, false) — never .removeProp() on natives.
One line:.prop() talks to live DOM state — use it for checked, disabled, and property-only names.
Frequently Asked Questions
.prop() gets or sets DOM properties on matched elements. As a getter it returns the property value (any type, or undefined) for the first element only. As a setter it updates every matched element by name/value, plain object, or callback. Available since jQuery 1.6.
.prop() reads and writes live DOM properties (booleans like checked and disabled that change at runtime). .attr() reads and writes HTML attributes (initial markup, usually strings). For form state, use .prop() or .is(":checked").
Prefer .val() for input, textarea, and select values. Use .prop() for boolean and structural properties like checked, disabled, and selectedIndex.
No. .prop(name) returns the first element's property only. Loop with .each() or .map() to read each one. Setters apply to every matched element.
No. Do not call .removeProp() on native properties — it causes unexpected behavior. Reset with .prop("checked", false) or .prop("disabled", false). .removeProp() is for custom properties you added.
The checked attribute maps to the initial default (defaultChecked) and does not update on click. The checked property is a live boolean. Use .prop("checked") or .is(":checked") to test current state.