
September 7th, 2005, 11:43 AM
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 22,309
Time spent in forums: < 1 sec
Reputation Power: 24
|
|
|
Changing a links text
i have this javascript function that hides and shows content but i want to alternate the text link to say show and hide onclick here is the function below and it hides and shows on click but it dosent change the links description
if(this.document.getElementById( id).style.display=='none'){
this.document.getElementById( id).style.display='inline';
Set_Cookie('showRightCol','true',30,'/','','');
var show = Get_Cookie('showRightCol');
document['HideHandle'].write('<a href="#">Hide</a>');
}else{
this.document.getElementById( id).style.display='none';
Set_Cookie('showRightCol','false',30,'/','','');
var show = Get_Cookie('showRightCol');
document['HideHandle'].write('<a href="#">Show</a>');
}
}
this is where i use it
echo '<div onclick='hideRightCol("rightCol");'> <a href="#" id="HideHandle" name="HideHandle" alt="Expand or collapse menu">Hide </a></div>';
|