title: How to show <Select > in sorted order
body: <p>How can I sort the <code>&lt;option&gt;</code> elements of a <code>&lt;select&gt;</code> tag using JavaScript?</p>
  
  <p>Here is the HTML I have:</p>
  
  <pre><code>&lt;form action="example.asp"&gt;
  &lt;div&gt;
  &lt;select size="3"&gt;
  &lt;option value="op2" &gt;Option 2&lt;/option&gt;
  &lt;option value="op1"&gt;Option 1&lt;/option&gt;
  &lt;option value="op4"&gt;Option 4&lt;/option&gt;
  &lt;option value="op3"&gt;Option 3&lt;/option&gt;
  
  &lt;/select&gt;
  &lt;/div&gt;
  &lt;/form&gt; 
  </code></pre>