Instead of changing the html of the actual resizable, why not put another container inside that will be converted to the text area?
You'd have something like:
<div id="area_3" class="dragThis" style="position: absolute; left: 43px; top: 5px; width: 237px; height: 157px; color: rgb(0, 0, 0);" data-color-default="#000" data-font-default="Verdana" data-content-type="text">
<div id="edit">
<h1>Business Name</h1>123 Right Here Way
<br>Tampa, FL 33607
<br>info@yoursite.com
<br>(813) 888-8888</div>
</div>
And instead of passing $(this)
to your editIt
function, you would pass $(this).find("#edit")
.
Here's a fiddle showing how that works. The re-binding of the click events would no longer be necessary, but you would want to track whether you're currently in edit mode. Example here: http://jsfiddle.net/WxwLa/