On page 10 are div with the item class.
When you click on this div, a .remove() jquery occurs and the element is deleted via AJAX.
Now after applying remove I need to calculate how much div.item data is on the page, through the code inspector I counted 9, but the script counts 1 more, first 10 (but there are 9), then 9 (but 8).
$('.item').click(function () { var divNumberOnPage = $('.item').length; console.log(divNumberOnPage); var setCurrentPagination = $('.number').html(divNumberOnPage); return setCurrentPagination; });