Reputation: 21
How can I make it so when you click the 2nd time it will go back? I guess I gotta somehow find the active one but not sure.
$("#test").click(function(){
$("#dsa").fadeOut()
$("#asd").fadeIn()
});
Upvotes: 1
Views: 1121
Reputation: 816262
Just use .toggle()
:
$("#test").click(function(){
$("#dsa, #asd").toggle(400);
});
Upvotes: 2