Forum Moderators: open
What I'm trying to do is start with a button on the screen that says "Turn on the reset button."
Then, when I click on it, have it turn off, and have the "Reset" button turn on and appear on the screen.
Then finally, when I click on the reset button, have the page refreshed and have the "Reset" button turn off and the "Turn on the reset button" button turn back on.
Or in other words, what I'm trying to do is make a reset button appear on the screen when I click on the "Turn on the reset button," and then have the reset button refresh the page and put things back the way they were at the start.
Below is the closest I've been able to get.
Help!
<HTML>
<HEAD>
<TITLE>Reset button</TITLE>
<SCRIPT type="text/javascript">
function turn_on_the_reset_button()
{
document.getElementById("turn_on_the_reset_button")
style.cssText.turn_on_the_reset_button="display:none";";
document.getElementById("reset_button")
style.cssText.reset_button="display:block;";
}
</SCRIPT>
</HEAD>
<BODY>
<div id="turn_on_the_reset_button">
<input type="button" onClick="turn_on_the_reset_button();" value="Turn on the reset button">
</div>
<div id="reset_button">
<style.cssText="display:none;" input type="button" onClick="refresh the page";
value="Reset">
</div>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>Reset button</TITLE>
<SCRIPT type="text/javascript">
function turn_on_the_reset_button() {
var elem = document.getElementById("turn_on_the_reset_button");
elem.style.display = (elem.style.display == 'block' ¦¦ !elem.style.display) ? 'none' : 'block';
elem = document.getElementById("reset_button");
elem.style.display = (elem.style.display == 'block' ¦¦ !elem.style.display) ? 'none' : 'block';
}
</SCRIPT>
</HEAD>
<BODY>
<div>
<button type="button" id="turn_on_the_reset_button" onclick="turn_on_the_reset_button();" style="display:block;">Turn on the 'refresh' button</button>
</div>
<div>
<button type="button" id="reset_button" onclick="window.location.reload();" style="display:none;">Refresh Page</button>
</div>
</BODY>
</HTML>