onclick show div et cacher un autre div

<div id="div1">A DIV element...</div>
<div id="div2">Another DIV element</div>
<div id="div3" hidden>A hidden DIV element</div>
<button id="switch">Click to hide visible DIVs and show hidden ones</button>
<script type="text/javascript">
	const div1 = document.getElementById("div1"),
		div2 = document.getElementById("div2"),
		div3 = document.getElementById("div3");
	document.getElementById("switch").addEventListener("click", function() {
		// hide element: element.hidden = true;
		// show element: element.hidden = false;
		div1.hidden = !div1.hidden;
		div2.hidden = !div2.hidden;
		div3.hidden = !div3.hidden;
	});
</script>
MattDESTROYER