title: Prototype: how to select nested elements?
body: <p>I have follow html structure:</p>
  
  <pre><code>&lt;div class="main"&gt;
     &lt;ul id="nav"&gt;
         &lt;li&gt;
               &lt;a&gt;&lt;/a&gt;
               &lt;div&gt;
                   &lt;ul class="level0"&gt;
                        &lt;li&gt;
                           .......                                
                        &lt;/li&gt;
                        .......
                        &lt;li&gt; 
                           .........
                        &lt;/li&gt;
                   &lt;/ul&gt;
               &lt;/div&gt;
         &lt;/li&gt;
         ......
         &lt;li&gt;
               &lt;a&gt;&lt;/a&gt;
               &lt;div&gt;
                   &lt;ul class="level0"&gt;
                        &lt;li&gt;
                           .........
                        &lt;/li&gt;
                        .........
                        &lt;li&gt; 
                           .........
                        &lt;/li&gt;
                   &lt;/ul&gt;
               &lt;/div&gt;
         &lt;/li&gt;
     &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I know how to select all first level li:</p>
  
  <pre><code>var listNodeLi = $('#main &gt; ul').childElements();
  listNodeLi.each(function(element)
  {
       alert(element.nodeName);
  });
  </code></pre>
  
  <p>But now for each <em>element</em> I have to select another li nodes by select like this:</p>
  
  <pre><code>element &gt; div &gt; ul
  </code></pre>
  
  <p>But I cannot understand how to combine <em>element</em> and css selectors after I got each <em>element</em>?</p>
  
  <p>PS:
  So, I've tried that, still didn't work. I got empty list.</p>
  
  <pre><code>  var arrLi = $('nav').childElements();
          arrLi.each(function(node)
          {
             list = $(node).down('ul.level0');
             alert(list);
             list.each(function(nodeLi)
             {
                alert(nodeLi.nodeName); 
             });
          });
  </code></pre>