On clicking child, I want to know the parent index no. Example, there is a div with 3 ul's when I click on each ul's child, it should show the parent index no. of it's parent. How can I get this?
jQuery:
$('.opSection').on('click','li',function(){
var num = $(this).parent('ul').index();
alert(num);
//alert(chartData.Indices[$(this).index()][$(this).index()]);
})
HTML:
<div class="opSection">//parent of all
<dl><dd>
<ul class="selectGroup" title='allIndia' data-select='1'>
<li data-index="123" class="c_on">All India</li> // when i click any of li i need 0
</ul>
<ul class="selectGroup" title='allIndia' data-select='1'>
<li data-index="123" class="c_on">All India</li> // when i click this, i need 1
</ul>
</dd></dl>
</div>