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

后端 未结 6 1886
再見小時候
再見小時候 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:55

    use this

        alert($("input[name=checkname]:checked").map(function () {return this.value;}).get().join(","));
    

提交回复
热议问题