title: How to dynamically add whitespace in element's text?
body: <p>I want to insert whitespace in DOM element.</p>
  
  <p>For instance, I want to change this</p>
  
  <pre><code>&lt;a&gt;&lt;/a&gt;
  </code></pre>
  
  <p>to this</p>
  
  <pre><code>&lt;a&gt; &lt;/a&gt;
  </code></pre>
  
  <p>If I manually add <code>&amp;nbsp</code> to DOM element, then it renders <code>&amp;nbsp</code> as a whitespace. But when I want to add this dynamically, I use <code>innerText</code>,</p>
  
  <pre><code> a_element.innertText = "&amp;nbsp"
  </code></pre>
  
  <p>and as result it doesn't convert <code>&amp;nbsp</code> to whitespace and renders it as a text (<code>&lt;a&gt;&amp;nbsp&lt;/a&gt;</code>). How can I fix this?</p>