Jquery - Store element text in variable for access after it has been altered
<p>Any help would be appreciated on this one, I'm a newbie when it comes to jquery and javascript but I have this section of code which I hashed together:</p>

<pre><code>$('.comment-data').click(function() {
    var ThisData = $(this);
    var Thistitle = ThisData.find('h4');
    var original = Thistitle.text();
    var ThisNext = ThisData.next().find('ol');
    ThisNext.stop(true, true).customToggle(500, function() {
    ThisNext.is(':visible') ? Thistitle.text('Hide Comments') : Thistitle.text(original);
});
});
</code></pre>

<p>it works fine apart from one thing; I need to store the initial text stored in the 'original' variable and keep that the same to access after I make a change to the text (replacing with 'Hide Comments'). Hope this makes sense, at the moment I assume variable Thistitle is being changed to value 'Hide Comments' then I am in effect writing over the original variable with this, hence when I set the text to my original variable I get 'Hide Comments'.</p>

<p>Thanks in advance for any insight into how to fix this, I have tried using .data but this just hashed everything up!</p>
