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