I have the following code for going from div "mainFrameOne" to div "mainFrameTwo". However, it cannot go back to mainFrameOne after changing to mainFrameTwo. And I want it to be able to keep switching back and forth. How would I best accomplish this?
HTML :
<div id="mainFrameOne">
<p>mainFrameOne</p>
</div>
<div id="mainFrameTwo" style="display:none;">
<p>mainFrameTwo</p>
</div>
<button onclick="myFunction()">Click me</button>
JS :
function myFunction() {
document.getElementById("mainFrameOne").style.display="none";
document.getElementById("mainFrameTwo").style.display="block";
}