I'm trying to add a class of 'this' when you click on an li, and when you click on a class with '.this' it doesnt work.
Even when i use the .on method it doesnt work. What am i missing? this is driving me crazy.
var thisLi = $('ul li');
$('li').on('click', function() {
$(thisLi).removeClass('that');
$(thisLi).removeClass('this');
$(this).addClass('this');
});
$('li.this').on("click", "li.this", function() {
$(this).addClass('that');
});