Check first radio button with JQuery Check first radio button with JQuery jquery jquery

Check first radio button with JQuery


If your buttons are grouped by their name attribute, try:

$("input:radio[name=groupName][disabled=false]:first").attr('checked', true);

If they are grouped by a parent container, then:

$("#parentId input:radio[disabled=false]:first").attr('checked', true);


$("input:radio[name=groupX]:not(:disabled):first")

This should give you the first non-disabled radio-button from a group...


The below does what you want:

$(document).ready(  function(){    $('input:radio:first-child').attr('checked',true);  }  );

Demo at: JS Bin.