0

If I open my sidebar html file the javascript is working as intended, it is a simple toggle that adds/removes a class to show what is the currently selected panel:

function showPanel(panel){
  disablePanels();
  document.getElementById(panel).classList.remove('inactive'); 
}

function disablePanels(){
  document.getElementById("user").classList.add('inactive'); 
  document.getElementById("settings").classList.add('inactive'); 
  document.getElementById("about").classList.add('inactive'); 
}

In my sidebar html file I have these links to trigger:

<a href="#" onclick="showPanel('about');"><i class="fas fa-solid fa-comment"></i></a>

This is working perfectly while I open the html file and click the icons, however when I click them from my addon sidebar/popup it is not working as expected.

S. W. G.
  • 353
  • 2
  • 16

0 Answers0