Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <select id="theSelect">
    <option value="blah">Blah</option>
    <option value="cough">Cough</option>
    <option value="foo">Foo</option>
    <option value="bar">Bar</option>
  </select>
  <script>
    (function() {
      var options = document.getElementById("theSelect").options;
      var n;
      for (n = 0; n < options.length; ++n) {
        if (options[n].value === "foo") {
          options[n].defaultSelected = true;
          break;
        }
      }
    })();
  </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers