I need help with some elementor accordion...
This is my code:
jQuery(document).ready(function () { jQuery('.elementor-tab-title').click(function () { let active = document.querySelectorAll(".elementor-tab-title elementor-active"); for(let j = 0; j < active.length; j++){ active[j].classList.remove("elementor-active"); active[j].nextElementSibling.style.maxHeight = null; //or 0px } });});
So, area-selected and area-expanded is switching to false when is closed and to true when its opened.
Class is switching from 'elementor-tab-title' when closed to 'elementor-tab-title elementor-active' when opened.
There are 6 of them, and I just can't figure out how to make them close when another is clicked to open.
Any help is appreciated. Thank you!