title: javascript document.createElement or HTML tags
body: <p>I am confused on following style of writing code. I want to know which is the <em>practical</em> and <em>efficient</em> method to insert HTML tag in document.</p>
  
  <p>Javascript:</p>
  
  <pre><code>document.getElementById('demoId').innerHTML='&lt;div&gt;hello world and &lt;a&gt;click me&lt;/a&gt; also&lt;/div&gt;';
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>var itd=document.createElement('div'),
      ita=document.createElement('a'),
      idt=document.createTextNode('hello world');
      iat=document.createTextNode('click me');
      idn=document.createTextNode('also');
  
      ita.appendChild(iat);
      itd.appendChild(idt);
      itd.appendChild(ita);
      itd.appendChild(idn)
  
      docuemtn.getElementById('demoId').appendChild(itd);
  </code></pre>
  
  <p>Which is the fastest and best method?</p>