Switch Tabs without Reloading Using Javascript
Switch Tabs without Reloading Using Javascript I have 3 tabs on a page. this tab Switching in Javascript . I have already set first tab is Default Open.. So.. I Click Second Tab is some Text and Submit button..i click the submit button it open the first tab.. i really want to second tab after the submit button.. Please Give me Example for my code. this my code here... function openCity(evt, cityName) { var i, tabcontent, tablinks; tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById(cityName).style.display = "block"; evt.currentTarget.className += " active"; } // Get the element with id="defaultOpen"...