<form>
<label><input type="radio" name="color" value="blue" />Blue</label>
<label><input type="radio" name="color" value="red" />Red</label>
</form>RadioNodeList: value property / notebook
RadioNodeList: value property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
// Get the form
const form = document.forms[0];
// Get the form's radio buttons
const radios = form.elements["color"];
// Choose the "red" option
radios.value = "red";