title: looping through elements jquery selector
body: <p>I have to select elements which contains id attribute and class attribute having 'child-of-' value and loop through the elements returned by the selector.</p>
  
  <p>So far i could write:</p>
  
  <pre><code>$('.child-of-').each(function(){
  ...
  });
  </code></pre>
  
  <p>This selects all the elements having class of child-of- including elements which does not have id also.
  There are elements which has that class but does not have any id attribute.
   so How can i select elements which has 'id' attribute and id has some value and also has class of child-of-. ?</p>
  
  <p>For example</p>
  
  <pre><code> &lt;div id="any1" class="child-of-"&gt;&lt;/div&gt;
   &lt;div id="any2" class="child-of-"&gt;&lt;/div&gt;
   &lt;div class="child-of-"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Only the div having id attribute must be selected. ie the first two divs in the example. the third does not have id attribute value and hence should not be selected</p>