I'm trying to add a class to a parent <li>, this is what I have been trying with no result:
function calendaractive(){
    $(this).parent('li').addClass("active");
}
HTML
<li>
    <a href="javascript:void(0)" onclick="calendaractive();">2009</a>
</li>
Why does this not work?
 
     
     
     
     
    