3 changed files with 31 additions and 0 deletions
@ -0,0 +1,9 @@
|
||||
document.querySelectorAll('.more-link').forEach(link => { |
||||
link.addEventListener('click', (e) => { |
||||
e.preventDefault(); |
||||
const container = link.previousElementSibling; |
||||
container.classList.toggle('full'); |
||||
link.textContent = container.classList.contains('full') ? 'Less' : 'More'; |
||||
link.setAttribute('aria-expanded', container.classList.contains('full')); |
||||
}); |
||||
}); |
||||
Loading…
Reference in new issue