portfolio / scripts /partials /dropdown.component.js
louisbrulenaudet's picture
Upload 78 files
503881f verified
raw
history blame contribute delete
350 Bytes
const dropdowns = document.querySelectorAll('.dropdown');
dropdowns.forEach((dropdown) => {
const shortDesc = dropdown.querySelector('.short-description');
const fullDesc = dropdown.querySelector('.full-description');
// Toggle open class on click
shortDesc.addEventListener('click', () => {
dropdown.classList.toggle('open');
});
});