document.querySelectorAll(".gx-pagination").forEach(pag => { pag.addEventListener("keydown", e => { const buttons = [...pag.querySelectorAll(".gx-page-btn:not(.disabled)")]; const active = pag.querySelector(".gx-page-btn.active"); const index = buttons.indexOf(active); if (e.key === "ArrowRight" && index < buttons.length - 1) { buttons[index + 1].focus(); } if (e.key === "ArrowLeft" && index > 0) { buttons[index - 1].focus(); } }); });