The task is to click on a button, save its id and apply it to the elements of nav__elem , so that when you click, for example, <button id="module-1"> , the selected class is applied to this button, and the selected class is also added to <span class="nav__elem module-1">nav elem 1</span> and so that when you reload the page, the changes are preserved, but if you click on the active button, the selected class will be deleted from the button and nav__elem module-1. Without using es6, multiple elements can be selected, not just one
<div class="nav"> <span class="nav__elem module-1">nav elem 1</span> <span class="nav__elem module-2">nav elem 2</span> <span class="nav__elem module-3">nav elem 3</span> </div> <div class="btns"> <button id="module-1">elem 1</button> <button id="module-2">elem 2</button> <button id="module-3">elem 3</button> </div>