Ok,
so I have:
<ul>
<li>hello</li>
<li>bye</li>
</ul>
Then:
$('li').click(function(){
$(this).remove();
})
But then i have:
if($('ul li').length == 0){
$('ul').append('<li>You haven\'t favourited anything. Get to it!</li>');
}
But it doesn’t work!
If you put that if statement outside of the call back, it tests for “no li elements” when the page loads, basically. You want it to test for “no li elements” after you have removed one, so the right place to do this is after you remove one. 🙂