Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Radio button selected?

Tags:

jquery

I'd like to know for a specific radio button group if a radio button is selected or not with jQuery.

Thanks

like image 382
Kris-I Avatar asked Aug 30 '09 07:08

Kris-I


1 Answers

if( $('input[name=groupName]').is(':checked') ){
      //do something
}

or my original answer before Paulo woke me up

  if( $('input[name=groupName]:radio:checked').length ){
      //do something
  }
like image 92
redsquare Avatar answered Nov 15 '22 17:11

redsquare