How can we access the value of a radio button using the DOM?

后端 未结 12 1880
鱼传尺愫
鱼传尺愫 2020-12-05 15:25

How can we access the value of a radio button using the DOM?

For eg. we have the radio button as :



        
12条回答
  •  萌比男神i
    2020-12-05 15:38

    If you need the selected one, most frameworks support functionality like this:

    //jQuery
    $("input[name='sex']:checked").val()
    

提交回复
热议问题