Check whether specific radio button is checked

后端 未结 7 1070
忘掉有多难
忘掉有多难 2020-12-14 01:10

I\'m having trouble after looking at the jQuery docs. I\'m just trying to return true/false in one my my jquery methods depending on the check of a certain radiobutton and

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 01:29

    Your selector won't select the input field, and if it did it would return a jQuery object. Try this:

    $('#test2').is(':checked'); 
    

提交回复
热议问题