title: Ordering a `<select>` with JavaScript (without jQuery)
body: <p>I have a <code>&lt;select&gt;</code> element which has some initial values, how can I add a value to the select and then order it alphabetically.</p>
  
  <p>I can add options with some simple JavaScript:</p>
  
  <pre><code>var select = document.getElementById("example-select");
  select.options[select.options.length] = new Option('Text 1', 'Value1');
  </code></pre>
  
  <p>...but that only appends it to the end.</p>
  
  <p><strong>How can I sort a <code>&lt;select&gt;</code> element by JavaScript without using jQuery.</strong></p>