You can use thisEvent.target to get handle to the button which was clicked, in CSJS.
Below is the piece of code which may help you out.
<xp:link escape="true" id="linkShowHide" title="Show Details" text="Show" >
<xp:eventHandler event="onclick" submit="false">
<xp:this.script>
<![CDATA[var
nodeDailyRecs = dojo.byId("#{id:dailyRecspanel}");nodeDailyRecs.style.display= (nodeDailyRecs.style.display == 'none')? "block" : "none"; _this = thisEvent.target;
if(nodeDailyRecs.style.display == 'none'){
_this.setAttribute('title',"Show Daily Hours");
_this.innerHTML = "Show"
}else {
_this.setAttribute('title',"Hide Daily Hours");
_this.innerHTML = "Hide"
}
]]></xp:this.script>
</xp:eventHandler>
</xp:link>