Lecseus,
это конечно очень слабенький пример я навожу
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div><button data-cl="one" onclick="HideOrShow(event, this)">Press 1</button>
<span class="one">Hello 1</span></div>
<div><button data-cl="two" onclick="HideOrShow(event, this)">Press 2</button>
<span class="two">Hello 2</span></div>
<script>
function HideOrShow(event, el){
if(el.getAttribute('data-cl') == el.nextElementSibling.className){
el.nextElementSibling.style.display = ( el.nextElementSibling.style.display == 'block'?'none':'block')
}
}
</script>
</body>
</html>