title: Iterating Through N Level Children
body: <p>This seems like something neat that might be "built into" jQuery but I think it's still worth asking.</p>
  
  <p>I have a problem where that can easily be solved by iterating through all the children of a element. I've recently discovered I need to account for the cases where I would need to do a level or two deeper than the "1 level" (just calling .children() once) I am currently doing.</p>
  
  <pre><code>jQuery.each(divToLookAt.children(), function(index, element)
      {
          //do stuff
      }
      );  
  </code></pre>
  
  <p>This is what I'm current doing. To go a second layer deep, I run another loop after doing stuff code for each element.</p>
  
  <pre><code>jQuery.each(divToLookAt.children(), function(index, element)
  {
       //do stuff
      jQuery.each(jQuery(element).children(), function(indexLevelTwo, elementLevelTwo)
      {
          //do stuff
      }
      );  
  }
  );
  </code></pre>
  
  <p>If I want to go yet another level deep, I have to do this all over again.</p>
  
  <p>This is clearly not good. I'd love to declare a "level" variable and then have it all take care of. Anyone have any ideas for a clean efficient jQueryish solution?</p>
  
  <p>Thanks!</p>