JSFiddle - React, Tailwind, and code Playground
by mikhailivanko
HTML
<button id="showContent">Показать</button>
<button id="hideContent">Скрыть</button>
<div class="content">
<div>Блок 1</div>
<div>Блок 2</div>
<div>Блок 3</div>
</div>
JavaScript
var content = document.querySelector('.content');
let show = document.getElementById("showContent");
let hide = document.getElementById("hideContent");
console.log(content)
show.addEventListener("click", () => {
content.style.display = "block";
});
hide.addEventListener("click", () => {
content.style.display = "none";
});