title: innerText property is not encoding the html
body: <p>I am trying to assign  the comment text  to an element, which is supposed to contain some html. So I am trying to encode the comment text before displaying it on the page after submitting. I have tried the following procedure but its not encoding the html. I want the html to be converted to literals.           </p>
  
  <pre><code>                var span=document.createElement("span");
                  span.innerText=commenttext;
                  console.log(span.innerText);
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>1) <code>commenttext</code> is a variable. </p>
  
  <p>2) by literals I mean encoded html... &amp;lt.. etc</p>