jQuery: how to get the index of a checked radio button

后端 未结 6 1796
再見小時候
再見小時候 2021-02-12 13:03

I recently came across a StackOverflow answer that gave excellent instructions on how to get the value of a checked radio button using jQuery:

var radioVal = $(\         


        
6条回答
  •  情深已故
    2021-02-12 13:36

    it return -1 because you get the value before any radiobutton was checked. i think you miss placed your listener and index checked. I just got the same error, but finally found the answer, i get the index before anything was checked, please check your code arrangement, the code stated above is right.

提交回复
热议问题