Hi There,
- I've got a list similar to the following:
<ul>
<li><a href="item1.php">item1</a></li>
<li><a href="item2.php">item2</a>
<ul>
<li><a href="item2-5.php">item2-5</a></li>
</ul</li>
<li><a href="item3.php">item3</a></li>
</li>
- Item 2 needs to have a class added to the li using jquery. I've tried the following but it isn't working:
<script>
jQuery(function(){
$(this).parent('li').addClass('current');
});
</script>
I'm new to jquery so I'm shooting in the dark somewhat here so if anyone can point me in the right direction is would be most appreciated.
I should mention that there'll be a few of these nested lists, the parents (li) of which will all need a class added via jquery.
Thanks,
Dan