Try this i'm not sure if it's what you're trying to do
Adding the toggle it will change the classes of the button removing one if it's already on the element and adding it if not.
I attached the handler to all the elements that their class starts with btn
this will make it work with both btn_close
and btn_open
$("#content").hide();
$("[class^=btn]").click(function () {
$(this).toggleClass("btn_open btn_close")
if($(this).hasClass("btn_close")){
$(this).text("close")
}else{
$(this).text("open")
}
$("#content").toggle("slow");
return false;
});