📜  单选按钮 getelementsbyname - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:08.248000             🧑  作者: Mango

代码示例2
var radioButtons = document.getElementsByName("Vehicle");for (var i = 0; i < radioButtons.length; i++) {    if (radioButtons[i].checked) {        console.log("radioButton " + i + ": " + radioButtons[i].value);    }}