jQuery :radio Selector (original) (raw)
Last Updated : 11 Jul, 2025
The **jQuery :radio Selector is used to select all elements of type radio. The working of ****$( “:radio” )** and ****$( “[type=radio]” )** is same. To select a group of radio buttons that are used in the form, we use ****$( "input[name=name_of_group]:radio" ).** It returns an array of input elements of type radio.
**Syntax:
- **Default Syntax:
$( "input[name=group_name]:radio" )
- **Syntax used to take advantages: Above syntax cannot take advantage of the performance optimization of native DOM so use the below syntax instead.
$("input[type=radio][name=group-1]")
**Method-1: $("input[type=radio]") This method of selection selects all input elements of type radio ie. every radio element of the page.
**Example 1:
HTML `
Document`
**Console:
**Output:
**Method 2- $("input:radio") This produces the same result as the previous one.
**Example 2:
HTML `
Document`
**Output:
**Method-3: $("input[type=radio][name=group-1]") This will select specified group of radio inputs from the form.
**Example 3:
HTML `
Document`
**Console:
**Output:
