Jestem bardzo, bardzo zielona w temacie i przyznam, ze jestem troche z siebie dumna, ze udalo mi sie dostsowac znaleziony gdzies w sieci kod i tak go wstawic ze dziala.
Chodzilo o zrobienie 2 buttonow, ktore zachowuja sie jak tabs. Czyli po kliknieciu na button1 pojawia sie niewidocznyd odtad div1 a po kliknieciu na button2 pojawia sie div2
Problem polega na tym, ze od kilku dni probuje dodac takie zahcowanie, aby po ponownym kliknieciu na button, zeby zniknal ten div, ktory sie pojawil po kliknieciu na ten buton.
Za Chiny nie moge tego uzyskac. Po prostu chce aby po kliknieciun nr 2 zniknela klasa active, ktora poajwial sie "na buttonie" dzieki kliknieciu nr 1
<script type="text/javascript">
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";
}
</script>