javascript getElementById radio button code example
Example 1: javascript how to select radio button
function check() {
document.getElementById("red").checked = true;
}
Example 2: radio button getelementsbyname
var radioButtons = document.getElementsByName("Vehicle");for (var i = 0; i < radioButtons.length; i++) { if (radioButtons[i].checked) { console.log("radioButton " + i + ": " + radioButtons[i].value); }}