count of selected radio buttons in jquery

后端 未结 3 1578
猫巷女王i
猫巷女王i 2021-02-20 06:38

suppose I have groups of radio buttons like so:

 
3条回答
  •  后悔当初
    2021-02-20 07:22

    To check for only those specific groups:

    $(':radio[name="rdQueen"]:checked, :radio[name="rdFruit"]:checked').length;
    

    Example: http://jsfiddle.net/AlienWebguy/HzfKq/

提交回复
热议问题