Reputation: 21
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?
Upvotes: 0
Views: 753
Reputation: 10713
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/
Upvotes: 3