Originally Posted by mark103
thanks for that, i have input the code in an external .js file. when i tried to test on my website, it doesn't work.
Well, it works for me.
Is the file in the correct directory?
Have you made sure that there are no HTML tags in the .js file?
Have you eliminated all typos?
Try the script in-line in your webpage - if/when it works move it to an external file.