JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript" language="javascript">jQuery.noConflict();</script>
<input id="showHide" type="button" value="Show/Hide" />
<div id="parentDiv">
<div id="targetDiv">This stuff will appear and disappear.</div>
</div>
JavaScript
var saveIt;
jQuery(function(){
jQuery('#showHide').click(function(){
if(jQuery('#targetDiv').is(':visible'))
hideIt();
else
showIt();
});
});
function hideIt(){
saveIt = jQuery('#targetDiv').fadeOut('slow',jQuery.fn.detach);
}
function showIt(){
//jQuery(saveIt).hide().appendTo('#parentDiv').fadeIn('slow');
jQuery(saveIt).appendTo('#parentDiv').show();
}