title: How do I dynamically create an <option> in JavaScript that contains an HTML entity (— ... «)?
body: <p>I'd like to add an &lt;option&gt; element to a &lt;select&gt; element where the &lt;option&gt; element's text contains an HTML entity: &amp;mdash;</p>
  
  <p>In HTML, the code would look like this:</p>
  
  <pre><code>&lt;select name="test" id="test"&gt;
      &lt;option value=""&gt;&amp;mdash; Select One &amp;mdash;&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>My JavaScript code looks like this:</p>
  
  <pre><code>function selectOne() {
    var e = document.getElementById('test');
    e.options[0] = new Option('&amp;mdash; Select One &amp;mdash;', '');
  }
  </code></pre>
  
  <p>However, as you will see if you test this, the &amp;mdash; becomes escaped. I had the same outcome when I tried:</p>
  
  <pre><code>e.options[o].text = '&amp;mdash; Select One &amp;mdash;';
  </code></pre>
  
  <p>(Observed behavior was in Internet&nbsp;Explorer 7 ... did not test with Firefox, Safari, etc. -- Internet&nbsp;Explorer 7 is the only browser I need at the moment.)</p>