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