title: jQuery: When creating a new element, do I need the ending tag?
body: <pre><code>var $div = $('&lt;div class="error"&gt;').appendTo($('#header'));
  </code></pre>
  
  <p>When creating new elements and adding them to the DOM, do you need the ending tag? why or why not? Do I only need the ending tag if i'm placing content into the tag i'm creating? like so:</p>
  
  <pre><code>var $div = $('&lt;div class="error"&gt; Error-Homie! &lt;/div&gt;').appendTo($('#header'));
  </code></pre>
  
  <p>or could I create an element with content in it, but leave out the ending tag? Good? Bad?</p>
  
  <pre><code>var $div = $('&lt;div class="error"&gt;').appendTo($('#header'));
  </code></pre>