I want add a class when a <li> element clicked. but it didn't work. Here's JQuery snippet
$(".mama").click(function(){        
    var arr = ["cat","dog", "mice", "bird"];
    alink =  $(this).text();        
    $.each(arr, function(index, value) {
        if(alink == value){
            $(this).addClass('hi'); 
        }
    }); 
});
And HTML
<ul id="animal">
    <li class="mama"><a href="#">cat</a></li>
    <li class="mama"><a href="#">dog</a></li>
    <li class="mama"><a href="#">Mice</a></li>
</ul>
i also have tried to do it by .map but nothing happen. please give solution and some explain. Thanks

