It seems to me that you have an error in your syntax. You're not closing the parenthesis for jQuery(".item").each();
$('.item').click(function() {
$(this).remove();
$('.item').each(function(index) {
$(this).attr('id', 'new_id-' + index);
});
});
Here's the jsfiddle - it recounts just fine