jQuery Click function isn't working on first child of li becomes '.contracted' as on jsFiddle
<ul class="clearfix">
<li class="contracted">
<a href="#">
<span>L1<b>: Recognize a digit represents 10 times the value</b></span>
</a>
</li>
<li class="">
<a href="#">
<span>L2<b>: Recognize a digit represents 10 times the value</b></span>
</a>
</li>
</ul>
I tried to move click function at bottom as well. But it isn't working. Full working example is given in jsFiddle.
$('.contracted').click(function () {
$(this).parent().attr('class', 'expanded');
$('ul.expanded li.activeLesson').attr('class', 'selected');
$('ul.expanded li:not(.selected)').attr('class', '');
});