Page is a not externally linkable
Fotiman - 6:09 pm on May 1, 2012 (gmt 0)
Not sure I understand what you mean. Did you have something like this?
<div id-"change-div">
<div id="text2">2...</div>
<div id="text3">3...</div>
</div>
In other words, is the source of the text that you're copying to change-div nested within change-div to begin with? If so, that would cause a problem because after the first call, the source would no longer exist. In other words, after the first call, your DOM would become:
<div id-"change-div">
2...
</div>
Therefore, subsequent button clicks would result in this:
var htmlStr = ( "#text2" ).html();
// htmlStr = null because #text2 no longer exists in the DOM