:radioS2C Home « Selectors « :radio

Form radio selector.

Shorthand version $(':radio')


The :radio selector, selects all elements of type radio.

Being a jQuery extension the :radio pseudo selector is not part of any current CSS specification. Therefore :radio cannot take advantage of the performance boost provided by the native DOM querySelectorAll() method.

The same results can be achieved with valid CSS using $('[type=radio]'), without the hit to performance.

If this selector is not preceded by another selector, the universal selector ("*") is implied and so the whole DOM will be searched. Use another selector as in the example below to narrow the search and improve performance.


Signature Description
jQuery(':radio')Form radio pseudo-class match





:radio ExampleTop

Selects all elements of type radio.

In the example below we apply a red border to radio elements within the form.

  $('.ourform').submit(function () { return false; }); // disable submit 
  $('#btn7').on('click', function() {
    $('form input:radio').wrap('<span></span>')
                         .parent().css('border', '1px solid red');

Pie Survey     




Which pie do you prefer?:

Select a pie shape: 


Press the button below to action the above code: