Remember the original state before "click"
<p>There is a button (actually a lot of them), it has an event handler:</p>

<pre><code>el.onclick = function(){
    if(this.className.indexOf("minimized") != -1){
        this.firstChild.nodeValue = 'turn back';
        this.className = this.className.replace("minimized", 'expanded');
    }
    else if(this.className.indexOf("expanded") != -1){
        this.firstChild.nodeValue = 'what was there before the first click';
        this.className = this.className.replace("expanded", 'minimized');
    }
}
</code></pre>

<p>Handler changes the state of the button.</p>

<p>Gentlemen, what is the standard way (pattern) to memorize a text node before the first click on current button and return it on the second click (on the same button)?</p>

<hr>

<p>Can you remember text node in a javascript variable, and not used for storing information HTML elements?</p>

<p>Without the use of global variables.</p>
