title: How to insert HTML as Text
body: <p>I want HTML, for example, <code>&lt;p&gt;</code>, to show show as just that, in plain text, and not interpreted by the browser as an actual tag.</p>
  
  <p>I know JQuery has .html and .text, but how is this done in raw JS?</p>
  
  <p>There are functions like encodeURIComponent that encodes <code>&lt;p&gt;</code> to <code>%3Cp%3E</code> but if I just put that into HTML, it interprets it literally as <code>%3Cp%3E</code>.</p>
  
  <p>So there are also things like <code>&amp;gt;</code> and <code>&amp;lt;</code>, they work but I can't find any JavaScript functions that escapes &amp; unescapes from this.</p>
  
  <p>Is there a correct way to show HTML as text with raw JavaScript?</p>