Sergiore,
вот так?
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>
div {
border: 1px solid black;
}
</style>
</head>
<body>
<div id="id1">1</div> и <div id="id2">2</div>
<script>
var id1 = document.getElementById('id1');
var id2 = document.getElementById('id2');
id1.addEventListener('click', function (event) {
this.style.display = 'none';
id2.style.display = 'block';
});
id2.addEventListener('click', function (event) {
this.style.display = 'none';
id1.style.display = 'block';
})
</script>
</body>
</html>