Checking Value of Radio Button Group via JavaScript?

前端 未结 8 661
清歌不尽
清歌不尽 2020-12-12 20:36

This may seem silly and downright stupid but I can\'t seem to figure out how to check the value of a radio button group in my HTML form via JavaScript. I have the following

8条回答
  •  猫巷女王i
    2020-12-12 20:56

    If you wrap your form elements in a form tag with a name attribute you can easily get the value using document.formName.radioGroupName.value.

提交回复
热议问题