:radio (since jQuery 1.0) selects every <input type="radio"> — the one-choice-per-group controls used in surveys, settings, and checkout. Official docs state it is equivalent to [type=radio]. Always prefer $("input:radio") over bare $(":radio").
Remember
$("input:radio") // all radio inputs
$("form input:radio") // radios inside a form
$("input[name=gender]:radio") // one radio group (official)
$("input[type=radio]") // equivalent attribute form
// Avoid on large pages:
$(":radio") // implies *:radio
Prefix with input, scope to a form or name, then style, count, or bind events.
Write $("input:radio") — never bare $(":radio") on large pages.
Scope to a form: $("#survey input:radio").
Target one group with the official pattern: $("input[name=gender]:radio").
Read the selected option with :checked and .val().
For hot paths, prefer input[type="radio"] so the browser can optimize.
Piece
Required?
Role
Selector string
Yes
:radio filter (best with an input prefix)
name attribute
Optional
Limits matches to one mutually exclusive group
Form / context
Optional
Avoids radios in unrelated widgets
Return value
—
jQuery collection of matching radio inputs (may be empty)
Pseudocode
Pseudocode
matches = []
for each element in search context:
if element.tag is input
and element.type is "radio":
matches.add(element)
return matches
// Official group filter:
keep only matches where name == "gender"
Reference
Cheat Sheet
Keep these facts handy while selecting radio buttons.
Topic
Detail
Syntax
$("input:radio")
Since
jQuery 1.0 · jQuery extension
Equivalent
$("[type=radio]")
Matches
input type="radio" only
Group scope
input[name=group]:radio
vs :checkbox
Different type — no overlap
Selected one
input:radio:checked
Native CSS
Use [type="radio"] for speed
Try it
Live Preview
Run different selectors against a small sample form and see how many radios match.
Sample markup mirrors the official jQuery form demo (button, checkbox, radios, text).
Result
$("form input:radio")
matched: 3
/* radios only — checkboxes and text ignored */
Code
jQuery Examples
Short, copy-ready snippets. Open DevTools Console with jQuery loaded, or use Try It Yourself for a live editor.
Example 1 — Official Demo: form input:radio
Wrap radios in styled spans and print the match count (jQuery API example).
jQuery
var input = $("form input:radio")
.wrap("<span></span>")
.parent();
$("#count").text("For this type jQuery found " + input.length + ".");
For this type jQuery found 2.
Both radios wrapped in <span>
Checkboxes and text → unchanged
How It Works
Scope.form input:radio searches radios inside the form only.
Filter. Only type="radio" matches — other inputs are ignored.
Wrap. Each match gets a <span> parent for styling.
Report..length is how many radios were found.
Example 2 — Equivalence: :radio vs [type=radio]
Official docs — both forms select the same elements.
jQuery
var a = $("input:radio").length;
var b = $("input[type=radio]").length;
console.log("input:radio →", a);
console.log("[type=radio] →", b);
console.log("same set?", a === b);
radios: 2
checkboxes: 1
Labels show [radio] or [checkbox]
How It Works
Type filter.:radio keeps radio inputs only.
Other type.:checkbox keeps checkbox inputs only.
No overlap. A control never matches both selectors.
Label text. Appending a marker on the closest label makes the split obvious.
Example 4 — Group Scope: input[name=gender]:radio
Official docs pattern — listen to one mutually exclusive group by name.
jQuery
$("input[name=gender]:radio").on("change", function () {
$("#out").text("Selected: " + this.value);
});
// size radios share a different name — not affected
Pick Female → Selected: female
Pick Male → Selected: male
Size radios → separate group, no handler conflict
How It Works
Name filter.[name=gender] limits the set to one HTML radio group.
Type filter.:radio confirms radio-type inputs.
Change. The handler runs when the user picks a gender option.
Isolation. Radios with another name never fire this handler.
Example 5 — Native Performance: input[type="radio"]
Official tip — use the attribute selector so modern browsers can optimize.
jQuery
var $radios = $("input[type='radio']");
$("#out").text("Found " + $radios.length + " radio(s) via [type=radio]");
// Pure DOM (no jQuery pseudo-class):
// document.querySelectorAll("input[type='radio']")
Found 2 radio(s) via [type=radio]
Works in querySelectorAll — no :radio extension needed
How It Works
Standard CSS.[type="radio"] is valid in native selectors.
Same matches. You still get every radio input.
Engine boost. jQuery can hand the query to querySelectorAll.
When to switch. Prefer this form on large pages or hot update paths.
Edge Cases & Pitfalls
Check these before relying on :radio in real forms.
slow
Bare $(":radio") scans everything
It implies *:radio. Prefer $("input:radio") or a form-scoped query.
non-std
Not valid in querySelectorAll
:radio is a jQuery extension. Use input[type="radio"] for native CSS queries.
group
Same page, many groups
Radios only exclude each other when they share a name. Scope with input[name=…]:radio.
state
:radio ≠ selected
:radio matches every radio. For the chosen one, add :checked.
Compatibility
Browser Support
The :radio pseudo-class is a jQuery extension and has worked since jQuery 1.0. The equivalent input[type="radio"] attribute selector is standard CSS and runs in native querySelectorAll.
✓ jQuery 1.0+ · extension
jQuery :radio Selector
Supported across jQuery 1.x, 2.x, and 3.x wherever your jQuery build runs. Prefer input:radio; use input[type="radio"] for native speed.
100%jQuery + native attr
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
:radioUniversal
Bottom line: Safe everywhere jQuery runs. Scope groups with input[name=group]:radio; prefer [type="radio"] when performance matters.
Analysis
Performance Notes
Approach
Cost
Best for
$("input[type=\"radio\"]")
Fastest
Modern browsers / hot paths
$("input:radio")
Cheap
Typical tutorials and small forms
$("#form input:radio")
Cheaper
Multi-form pages
$(":radio")
Slower
Avoid — universal scan
Official jQuery docs note that because :radio is not CSS, it cannot use the querySelectorAll boost. Prefer [type="radio"] when the page is large or you re-query often.
Remember
Key Takeaways
Role: select every input type="radio" in scope.
Prefix: use $("input:radio"), not bare $(":radio").
Groups:input[name=…]:radio targets one mutually exclusive set.
Speed: prefer [type="radio"]; for the chosen option use :checked.
One line:$("input:radio") finds radio buttons — scope by form or name, and use [type="radio"] when you need native speed.
Frequently Asked Questions
:radio selects every input whose type is radio — mutually exclusive options in a form group. $("input:radio") finds all radio buttons in the search context. Available since jQuery 1.0.
Prefer $("input:radio"). Bare $(':radio') implies the universal selector and scans as $('*:radio'), which is slower on large pages. Official jQuery docs recommend prefixing with input or another selector.
Yes. Official docs state that :radio is equivalent to $('[type=radio]'). For native querySelectorAll performance in modern browsers, prefer input[type="radio"] over the :radio pseudo-class.
:radio matches input[type="radio"] only. :checkbox matches input[type="checkbox"] only. They never overlap — use the correct pseudo-class for each control type.
Official docs example: $("input[name=gender]:radio") selects radio buttons with name="gender" only. Combine the name attribute filter with :radio to target a single mutually exclusive group.
No. It is a jQuery extension (not part of the CSS specification), so queries using :radio cannot use the native querySelectorAll boost. Use [type="radio"] when performance matters.