I'm having an issue with a piece of JS that doesn't seem to want to work.
I created a tab widget, following this guide: https://www.w3schools.com/howto/howto_js_tabs.asp
I replaced onclick with onmouseover in the html part and changed the buttons to a-type elements:
Original:
<button class="tablinks" onclick="openCity(event, 'London')" id="defaultOpen">London</button>
My version:
<a class="tablinks" onmouseover="openCompany(event, 'xName') "id="defaultOpen">Link</a>
Now that's all working fine. But further down the page it explains how to keep a certain tab open by default but it doesn't seem to be working alright. Neither in the original nor in my version.
Original:
document.getElementById("defaultOpen").click();
My version:
document.getElementById("defaultOpen").mouseover();
Has anyone got an idea why this wouldn't work? It's driving me nuts!