Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
150
rated 0 times [  155] [ 5]  / answers: 1 / hits: 68201  / 13 Years ago, mon, march 28, 2011, 12:00:00

I have two buttons.



I have two divs I want to show.



Each divs have different content.



I want both divs to only take up the same amount of space on the page.



I want it so on page load, div1 is shown, and if they click link div2, div1 disappears and div2 appears in its place.



What is the best way to go about doing this? and how?


More From » jquery

 Answers
11

All the initial CSS and onload stuff aside and you're using jquery,
I think you're looking for something like



$(#button2).click(function(){
$(#div1).hide();
$(#div2).show();
})

[#93053] Friday, March 25, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ishmaelw

Total Points: 528
Total Questions: 96
Total Answers: 103

Location: Venezuela
Member since Sat, Apr 24, 2021
3 Years ago
;