window.addEventListener("load", function() {
var links = document.querySelectorAll('.committee-list a');
links.forEach(function(link) {
link.addEventListener('click', function(e) {
e.preventDefault();
// Remove active from all links
links.forEach(function(l) {
l.classList.remove('active');
});
this.classList.add('active');
var target = this.getAttribute('data-target');
// Hide all tables
var contents = document.querySelectorAll('.committee-content');
contents.forEach(function(div) {
div.classList.remove('active');
});
// Show selected table
var activeDiv = document.getElementById(target);
if (activeDiv) {
activeDiv.classList.add('active');
}
});
});
});