views:

52

answers:

1

My website has previous and next buttons. When the page loads id like the previous button to be invisible.(on the first panel) After the user clicks the next button (to go to 2nd panel), id like the previous button to appear.

Is there some javascript that will do this?

+6  A: 

Add a CSS display: none; to the Previous button then add an onclick event to the button:

<input id="next" type="button" name="next" onclick="document.getElementById('previous').style.display = 'block';
" />

Where #previous = the ID of your previous button.

If you are having trouble, see this link for 7 ways to hide elements using JavaScript: http://www.dustindiaz.com/seven-togglers/

Neurofluxation
*sigh* Lack of people accepting answers today :'(
Neurofluxation
do i add the onclick event to the next button?
daniel
Yes indeedy, you can reverse the code and put it on the Previous button as well - just replace the getElementById('pervious') to getElementById('next') ^_^
Neurofluxation