title: How to check if a dynamically created element already exists using jQuery?
body: <p>I create an element dynamically:</p>
  
  <pre><code>var $el = $('&lt;div class="someclass"&gt;&lt;/div&gt;');
  </code></pre>
  
  <p>I want to append the element (<code>$el</code>) somewhere, but it shouldn't have an <code>id</code>.</p>
  
  <p>How do I know if it has been appended before or not?</p>
  
  <p><strong>edit</strong><br>
  I thought this should work</p>
  
  <pre><code>if($($el, "#target").length == 0)
      $("#target").append($el);
  </code></pre>
  
  <p>but that was wrong</p>