function toggleActivities(listId) { const list = document.getElementById(listId); const items = list.querySelectorAll('li:nth-child(n+4)'); for (let item of items) { item.style.display = item.style.display === 'list-item' ? 'none' : 'list-item'; } // Update button text dynamically const button = list.nextElementSibling; button.textContent = button.textContent === 'More' ? 'Less' : 'More'; }