14 lines
533 B
JavaScript
14 lines
533 B
JavaScript
var headers = document.querySelectorAll('.tabSectionHeader');
|
|
headers.forEach(function (header) {
|
|
header.addEventListener('click', function () {
|
|
var clickedParent = header.parentNode;
|
|
headers.forEach(function (otherHeader) {
|
|
var otherParent = otherHeader.parentNode;
|
|
if (otherParent !== clickedParent) {
|
|
otherParent.classList.remove('chartActiveOpenClose');
|
|
}
|
|
});
|
|
clickedParent.classList.toggle('chartActiveOpenClose');
|
|
});
|
|
});
|