Why does not the test?

$('.cart-item__close-btn').click(function(){
$(this).parent().remove();
checkItems();
});

function checkItems(){
 if($('#card-list').children('li').length < 0 ){
alert('Hello');
}
}


Why not fire the validation on click? If check > 0 then everything works. As I said, test it stops after the first click the button.

UPD: test
July 2nd 19 at 13:22
1 answer
July 2nd 19 at 13:24
Solution
1) length can not be less than zero
2) you do have some remov happens, can it work?
3) I test the example it is unclear for now
Updated - jordy_Zemlak73 commented on July 2nd 19 at 13:27
: hoho, now you have decided to assign zero thumbs up) - gustave_Kertzmann52 commented on July 2nd 19 at 13:30
like) - jordy_Zemlak73 commented on July 2nd 19 at 13:33

Find more questions by tags JavaScriptjQuery