There is a function that changes the blocks when you click on the navigation tab ...

function openCity(cityName) { var i; var x = document.getElementsByClassName("city"); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } document.getElementById(cityName).style.display = "block"; } 

Help to edit the function so that when the page is refreshed all the blocks are closed and only when you click on the tab the corresponding block opens.

ps at the moment when the page is updated, the blocks are initially open

    2 answers 2

    there should be something like in styles

     .city:first-child { display: block; } 

    delete it. also the first tab should have something similar

       .city { display: none; } 

      correct answer