В итоге, нашел решение:
<head>
<title>Example</title>
</head>
<body>
<button onclick="replace();return false"/>Click to Replace</button>
<button onclick="replace2();return false"/>Click to Replace2</button>
<div id = "div1" style="display:block">Text1</div>
<div id = "div2" style="display:none">Text2</div>
<script>
function replace() {
document.getElementById("div1").style.display="block";
document.getElementById("div2").style.display="none";
}
function replace2() {
document.getElementById("div1").style.display="none";
document.getElementById("div2").style.display="block";
}
</script>
</body>