How do I switch html files in my extension popup?

My extension has different tab buttons in the popup (see image below) which should switch between different html pages when clicked. But the extension freezes when I try clicking them.


Here’s an example of the code for the ‘contact’ button:

 contactTab = document.getElementById("contact-tab")
 contactTab.addEventListener("click", function() {
     location = "contact.html"

I’ve tried using location, window.location and location.href, but none of those worked. I’m guessing it’s because it assumes that I’m trying to change something in the browser rather than the popup? Or maybe it can’t find the other html files? I’m not sure.

Here’s a link to my extension if you want to see the problem for yourself:

Any help is very much appreciated, thank you in advance.