title: Which is better: string html generation or jquery DOM element creation?
body: <p>Ok, I'm rewriting some vanilla JS functions in my current project, and I'm at a point where there's a lot of HTML being generated for tooltips etc.</p>
  
  <p>My question is, is it better/preferred to do this:</p>
  
  <pre><code>var html = '&lt;div&gt;&lt;span&gt;Some More Stuff&lt;/span&gt;&lt;/div&gt;';
  if (someCondition) {
      html += '&lt;div&gt;Some Conditional Content&lt;/div&gt;';
  }
  $('#parent').append(html);
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>var html = $('&lt;div/&gt;').append($('&lt;span/&gt;').append('Some More Stuff'));
  if (someCondition) {
      html.append($('&lt;div/&gt;').append('Some conditionalContent');
  }
  $('#parent').append(html);
  </code></pre>
  
  <p>?</p>