title: Add Ampersand Character Codes to HTML via JavaScript
body: <p>I'm trying to add the times sign <code>&amp;times;</code> to an HTML template using javascript. Unfortunately the HTML is reading the ampersand character code as a string. How can I fix this?</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;button id='b'&gt;Add Symbol&lt;/button&gt;
  &lt;div&gt;&amp;times;&lt;/div&gt;
  &lt;div id='container'&gt;&lt;/div&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>document.getElementById('b').onclick = addSymbol;
  function addSymbol() {
      var pTag = document.createElement('p');
    var pTagContent = document.createTextNode('&amp;times;');
    pTag.appendChild(pTagContent);
  
    var container = document.getElementById('container');
    container.appendChild(pTag);
  }
  </code></pre>
  
  <p><a href="https://jsfiddle.net/a2w1w0n3/" rel="nofollow noreferrer">https://jsfiddle.net/a2w1w0n3/</a></p>