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