Javascript creating an HTML object vs creating an HTML string
<p>Pretty simple question that I couldn't find an answer to, maybe because it's a non-issue, but I'm wondering if there is a difference between creating an HTML object using Javascript or using a string to build an element.  Like, is it a better practice to declare any HTML elements in JS as JS objects or as strings and let the browser/library/etc parse them?  For example:</p>

<pre><code>jQuery('&lt;div /&gt;', {'class': 'example'});
</code></pre>

<p>vs</p>

<pre><code>jQuery('&lt;div class="example&gt;&lt;/div&gt;');
</code></pre>

<p>(Just using jQuery as an example, but same question applies for vanilla JS as well.)</p>

<p>It seems like a non-issue to me but I'm no JS expert, and I want to make sure I'm doing it right.  Thanks in advance!</p>
