title: Replace HTML element with string content using native JS
body: <p>There is the following HTML code:</p>
  
  <pre><code>&lt;body&gt;
    &lt;menu&gt;
    &lt;/menu&gt;
    ... other html
  &lt;/body&gt;
  </code></pre>
  
  <p>I need to replace <code>&lt;menu&gt;</code> tag with HTML content from variable. I know how I can change innerHTML using string variable with content (variable 'template');</p>
  
  <pre><code>menu.innerHTML = template;
  </code></pre>
  
  <p>Variable 'template' contains <code>'&lt;ul class="menu"&gt;&lt;/ul&gt;'</code>. As result I want to have the following HTML:</p>
  
  <pre><code>&lt;body&gt;
    &lt;ul class="menu"&gt;
    &lt;/ul&gt;
    ... other html
  &lt;/body&gt;
  </code></pre>