Non ho capito, intendi una cosa del genere?
Codice HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test elementi nascosti</title>
<style type="text/css">
div {height:200px; width: 200px;}
#num1{background-color:#F00}
#num2{background-color:#0F0}
#num3{background-color:#00F}
</style>
<script type="text/javascript">
window.onload = function()
{
document.getElementById('cliccami').addEventListener("click", function(){
document.getElementById('num1').style.display = "none";
document.getElementById('num3').style.display = "none";
});
}
</script>
</head>
<body>
<div id="num1">Elemento 1</div>
<div id="num2">Elemento 2</div>
<div id="num3">Elemento 3</div>
<button id="cliccami">nascondi 1 e 3</button>
</body>
</html>
Ciao!