When I navigate to my new profile tab, I encounter an issue where I cannot switch to other tabs by clicking on them. Below is the code snippet that I am using. Navigating from the Dashboard tab to the New Profile tab works fine, but the reverse direction does not work. Also, switching from the New Task tab to the New Profile tab works fine, except for moving from the New Profile tab to another tab.
document.getElementById("defaultOpen").click();
function openCity(evt, cityName) {
// Declare all variables
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
// Get all elements with class="tablinks" and remove the class "active"
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
// Show the current tab, and add an "active" class to the button that opened the tab
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
console.log("hello");
}
label {
display: inline-block;
width: 160px;
text-align: right;
}
input {
width: 140px;
}
/* Additional CSS styling goes here */
Unable to switch to the dashboard or New Task tab after visiting the New Profile tab