Replace text links with images using javascript
A quick tutorial in which I show you how to replace text links with images using javascript.
We are goin to be using W3C DOM specific functions in our javascript so first we will check for its presence.
for the purpose of this tutorial we are going to assume that you want to replace every single text link in your document with an associated image. To do this we are going to store the image name in the 'id' attribute of the link as follows:
Now for the javascript function that does the replacing
Now all you need to do is call the script into action when the page loads
The complete javascript should now look like this
Comments:
Featured Script
PHP Send this page to a friend script
as the title suggests you can add this script to any of your pages and and it will allow your visito... (read more)
