I guess this pen does what you wanted to achieve:
http://codepen.io/anon/pen/zGgVzG
var c = " closed";
var o = " open";
$("a").append(c);
$("button").click(function(){
$("a").text($("a").text().replace(c, o));
});
You can't use jQuery's find() and replace methods to replace text. These work on dom elements, not on strings. Use the text function to set the link's text and use JavaScript's native replace function to do text replacements.
To clarify, the following code does the same as above, but might be easier to understand:
var c = " closed";
var o = " open";
$("a").append(c);
$("button").click(function(){
var linkText = $("a").text();
var replacedText = linkText.replace(c, o);
$("a").text(replacedText);
});