function toggleTableOfContent(e) { const toc = document.getElementById('TableOfContents'); toc.classList.toggle("show"); const extend = toc.parentElement.getElementsByClassName("extend")[0]; extend.children[0].classList.toggle("icon-angle-right"); extend.children[0].classList.toggle("icon-angle-left"); }