if (imagem.classList.contains('dashboard__item__img--rented')) { imagem.classList.remove('dashboard__item__img--rented') botao.classList.add('dashboard__item__button--rented') botao.textContent = 'Alugar' } else { imagem.classList.add(''dashboard__item__img--rented') botao.textContent = 'Devolver' botao.classList.remove('dashboard__item__button--rented' }
Um otimo teste pra logica