Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <form>
    <fieldset>
      Apples: <input type="radio" name="group1" value="Apples">
      Oranges: <input type="radio" name="group1" value="Oranges" checked>
      Bananas: <input type="radio" name="group1" value="Bananas">
    </fieldset>
    
    <fieldset>
      Carrots: <input type="radio" name="group2" value="Carrots" checked>
      Celery: <input type="radio" name="group2" value="Celery">
      Lettuce: <input type="radio" name="group2" value="Lettuce">
    </fieldset>
    
    <fieldset>
      Bagels: <input type="radio" name="group3" value="Bagels">
      Muffins: <input type="radio" name="group3" value="Muffins">
      Cupcakes: <input type="radio" name="group3" value="Cupcakes" checked>
    </fieldset>
    
  </form>
</body>
</html>
 
console.clear();
let myForm = document.forms[0],
    myRadio1 = myForm.elements['group1'],
    myRadio2 = myForm.elements['group2'],
    myRadio3 = myForm.elements['group3'];
myRadio3[2].checked = false;
console.log(myRadio1.value);
console.log(myRadio2.value);
console.log(myRadio3.value);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
ImpressiveWebspro
0viewers