How to add a div in jquery even if you have just used the .remove() function on it

How to add a div in jquery even if you have just used the .remove() function on it

Hi,

 Below is my code which I am using to remove a div tag. I also want the script to add the same div tag later once certain conditions are meet. The div has some preloaded content too which I don't want to loose.

What function do I use to add the div. .add() does not seem to work.




$('#wrapper1').remove();

Any help will be highly appreciated.

Cheers, Vishal