: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").
Syntax
Start with these common calls. Keep them short and readable.
jQuery
$("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
Call
What it does
Selector string
:radio filter (best with an input prefix)
name attribute
Limits matches to one mutually exclusive group
Form / context
Avoids radios in unrelated widgets
Return value
jQuery collection of matching radio inputs (may be empty)
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Write $("input:radio") — never bare $(":radio") on large pages.
Step 2
Scope to a form: $("#survey input:radio").
Step 3
Target one group with the official pattern: $("input[name=gender]:radio").
Return Value
Return Value
Description
See examples
Check the examples below for what this API returns in common cases.
jQuery Examples
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.
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.
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.