title: Removing elements without id from a jQuery selection?
body: <p><strong>How can i remove elements without <code>id</code> property from the collection (not from the DOM itself) on which the plugin was invoked?</strong></p>
  
  <pre><code>&lt;span id="id737293" class="attach"&gt;&lt;/span&gt;
  &lt;div class="attach"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>jQuery invocation and plugin:</p>
  
  <pre><code>$('.attach').attach();
  
  (function($) {
  
      $.fn.attach = function(options) {
         // Remove elements (without id) on which the plugin was invoked
         var valid = ???;
  
         // Loop each valid element (with id attribute) and process
         valid.each(function() {
         });
  
         return this; // Maintain chainability
      };
  
  })(jQuery);
  </code></pre>