Good afternoon, your help is required. Made a side menu, in the main div registered:
id="sidebar" And on the button that is above the above mentioned div has assigned a class:
class="open" Then I inserted a small JS code:
var menuElem = document.getElementById('sidebar'); var sidebarElem = menuElem.querySelector('.open'); sidebarElem.onclick = function() { menuElem.classList.toggle('close'); }; In css I registered styles so that the side menu after clicking on the button was hidden by% so 90. Everything works wonderfully. But! When the menu is hidden, the main content remains in its place, and I need it to move exactly as much as I hide the sidebar and so that it will be immediately in one click. And not just the main content. Since you can insert one unique identifier in getElementById, how should you be able to interact with several elements?
I hope I described it clearly, I hope for your help!