I do a click on the random block function:
function randomChange() { var numItems = $('.tablebox').length; var randomBlock = getRandomArbitary(2, numItems - 2); $(".tablebox:eq(" + randomBlock + ")").click(); } It is necessary to hide the previous item when clicking on a new one. How can I memorize the index of the previous item?