-
-
Save ilyasozkurt/24989887a3962997cfc8b137983a1e43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const prevButton = document.getElementById("prev"); | |
const nextButton = document.getElementById("next"); | |
prevButton.addEventListener("click", () => { | |
if (currentPage > 0) { | |
currentPage -= 1; | |
displayRows(); | |
} | |
}); | |
nextButton.addEventListener("click", () => { | |
const lastPage = Math.ceil(tbody.querySelectorAll("tr").length / rowsPerPage) - 1; | |
if (currentPage < lastPage) { | |
currentPage += 1; | |
displayRows(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment