jquery validation radio button code example

Example 1: jQuery check a radio button

// jQuery version 1.6 or above use:  
$("#myRadioID").prop("checked", true);
 
//jQuery versions below 1.6 use:
$("#myRadioID").attr('checked', 'checked');

Example 2: how to do radio button validation in jquery

if($("input[name='Gender']:checked").length == 0)

Example 3: click on a radio button using jquery

$('input:radio[name=sex]:nth(0)').attr('checked',true);
or
$('input:radio[name=sex]')[0].checked = true;

Example 4: how to validate the radio button using jquery

BY LOVE
if ($("input[name='Gender']:checked").length == 0)