js radio checked code example Example: javascript how to select radio button function check() { document.getElementById("red").checked = true; }