title: Why can't write the id=show attribution with the show function?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> 
  
  function show(){
      table_show = '&lt;table id="show"&gt;';
      table_show += "&lt;tr&gt;";
      table_show += "&lt;td&gt;" + "id" + "&lt;/td&gt;";
      table_show += "&lt;td&gt;" + "date" + "&lt;/td&gt;";
      table_show += "&lt;td&gt;" + "type" + "&lt;/td&gt;";
      table_show += "&lt;/tr&gt;";
      table_show += "&lt;/table&gt;";
      var parent = document.body;
      var tmp = document.createElement("table");
      tmp.innerHTML = table_show;
      parent.appendChild(tmp);
  }
  
  ob = document.getElementById("bShow");
  ob.addEventListener("click",show);
   </code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code> 
  &lt;input id="bShow" type="button" value="show_table"&gt;
   </code></pre>
  </div>
  </div>
        </p>
  
  <p>I want to  add a new table with <code>show</code> function,when you click the button to invoke the show function via addEventListener, the new table created ,but without the <code>id="show"</code> attribution in it ,why?
  The first line in show function is :</p>
  
  <pre><code>table_show = '&lt;table id="show"&gt;';
  </code></pre>
  
  <p>Why no <code>id="show"</code> in the new table created?</p>
  
  <p><a href="https://i.stack.imgur.com/ToF0J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ToF0J.png" alt="enter image description here"></a></p>