**17 Feb 2022
**17 Jan 2022-2:
**17 Jan 2022-1:
Here is the script:
`// Get all the tabs
const tabs = document.querySelectorAll(“td.td1”);
// Store the previous selected tab so we know which one to remove the class from
let prevSelected;
// Give each tab code
for (const tab of tabs) {
// Add a function to run when it is clicked
tab.addEventListener(“click”, evt => {
// Remove the current class from the last selected element
// On first run, prevSelected is not defined, so we need to check
if (prevSelected) prevSelected.classList.remove(“current”);
// Update prevSelected
prevSelected = evt.srcElement;
// Add the current class
evt.srcElement.classList.add(“current”);
});
}
`
I also made a new version of the page that uses an iframe instead of a frameset. The script doesn’t work in either version. Here are links to both versions. Hopefully someone can help me figure out why it isn’t working.
[Frameset version
[Tabstrip for Frameset
[iFrame version
**14 Jan 2022:
Edit: I have been studying the javascript code generated by Excel hoping to get a clue to no avail. All it has done is caused me to have more questions.
What is the iIEVer property and why does my browser throw an uncaught exception error when it encounters it?
Why does the fnupdatetabs function seem to call itself if iIEVer is <4?
`function fnUpdateTabs()
{ if (parent.window.g_iIEVer>=4) {
if (parent.document.readyState==”complete”
&& parent.frames[‘frTabs’].document.readyState==”complete”)
parent.fnSetActiveSheet(15);
else
window.setTimeout(“fnUpdateTabs();”,150);
}
}
`
This function occurs in each sheet file, and I think this may have something to do with the error since the main javascript is in the frameset page. The upper frame does get updated with the file selected when you click the link in the tabstrip, but nothing happens in the tabstrip that is visible, so I don’t know what is being updated (or if anything even is being updated due to the error).
Edit 2: I looked at the JavaScript generated by Excel and realized that it does nothing. I guess it only applies to Outlook or some older versions of Internet Explorer. I was able to achieve roll-over using CSS alone, but hiliting the currently selected link tab is not happening. I don’t know if it can be done solely with CSS, which is why I asked this here first. I have no clue how to even begin writing something like this and could use the help.