Change Link Text | JavaScriptSource

Change Link Text

JavaScriptSource Staff Jul 9, 2007

General

Use this little script to change the link text after it has been clicked. Short and easy to use!


Click to test
Click to test

Notes

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: changeLinkText.js


Head

Paste this code into the HEAD section of your HTML document.


Body

Paste this code into the BODY section of your HTML document


Leave a Response

(1 comment)

Thanks for this code snippet. It worked great and the 1st time![br /][br /]However, what if I want the text to change back to what it started with. For example, I have a link 'Show More' when clicked now using your script it says 'Show Less'. However, if clicked again it still says 'Show Less' How can I get it to return to 'Show More'

Kevin Aug 23, 2007