const scrollbox = document.querySelector(".scrollbox"); const arrow = scrollbox.querySelector(".scrollbox::before"); scrollbox.addEventListener("scroll", function() { if (scrollbox.scrollTop + scrollbox.clientHeight >= scrollbox.scrollHeight) { arrow.style.display = "none"; } else { arrow.style.display = "block"; } }); const scrollbox = document.querySelector(".scrollbox"); scrollbox.addEventListener("click", function() { scrollbox.classList.toggle("expanded"); });