title: Jquery : find length of mixed list
body: <p>This is example list :</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li&gt;Item:
          &lt;ol&gt;
              &lt;li&gt;Point:
                  &lt;div&gt;
                      &lt;ul&gt;
                          &lt;li&gt;elem1&lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/div&gt;
              &lt;/li&gt;
          &lt;/ol&gt;
      &lt;/li&gt;
      &lt;li&gt;elem2&lt;/li&gt;
  &lt;/ul&gt;
  &lt;ul&gt;
      &lt;li&gt;Point:
          &lt;div&gt;
              &lt;ul&gt;
                  &lt;li&gt;elem1&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  &lt;ul&gt;
      &lt;li&gt;simple list1&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I have a code to find depth from unordered list :</p>
  
  <pre><code>var n = 0
  
  $('ul').each(function(i){ 
      if (($(this).parents('ul').length + 1) &gt; n) { n = $(this).parents('ul').length + 1; }
  });
  </code></pre>
  
  <p>But what to do if more than one list and which are mixed list ?</p>
  
  <p><strong>EDIT</strong> : Here mixed list means <code>ul</code> list and <code>ol</code> list.</p>