title: Which method is better/ faster for performance - createElement or innerHTML?
body: <p>I'm making divs with several sub elements something like this:</p>
  
  <pre><code>&lt;div class="item" data-id="28"&gt;
      &lt;div class="action-btns"&gt;
          &lt;button class="add"&gt;&lt;/button&gt;
          &lt;button class="rmv"&gt;&lt;/button&gt;
      &lt;/div&gt;
      &lt;div class="info"&gt;
          &lt;h3&gt;Title here&lt;/h3&gt;
          &lt;span&gt;caption here&lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And im giving functions to those two buttons on click. I'm wondering which method of creating these items is better - <strong>createElement</strong> <em>or</em> <strong>innerHTML</strong>?</p>
  
  <p>As far as <strong>createElement</strong> goes i like it because i can bind the onclick while creating the button inside the element and then append it. Also im wondering if appending this "item" to the parent div is faster / better than updating innerHTML += "something";</p>
  
  <p>As far as <strong>innerHTML</strong> goes there are fewer lines of code to write, but also i have to either write the onclick="myFunction()" inside the buttons instead of adding it dynamically.</p>
  
  <p>Please no jQuery or anyting but pure Js. Thanks for your time <strong><em>:)</em></strong></p>