JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/ui-lightness/jquery-ui.css">
<div id='somediv'>
    some original content
    <span id='mySpan'>some original content in the span</span>
</div>

JavaScript

var myVar;

// Add the new content, and append the element stored in myVar
$('#somediv').toggle(function() {
    myVar = $(this).contents();
    $(this).html('some new content<br>');
}, function() {
    $(this).html( myVar );
});