This is very nice post
📈 Updated Content & Research Findings
function toggleAccordion(element) {
const content = element.nextElementSibling;
const arrow = element.querySelector(‘.accordion-arrow’);
if (content.style.maxHeight && content.style.maxHeight !== ‘0px’) {
content.style.maxHeight = ‘0px’;
arrow.style.transform = ‘rotate(0deg)’;
element.style.background = ‘linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%)’;
} else {
content.style.maxHeight = content.scrollHeight + ‘px’;
arrow.style.transform = ‘rotate(180deg)’;
element.style.background = ‘linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%)’;
}
}