Originally Posted by mark103
that will only work inb the html document even not in the external .js file
please post an example code that work for you in a html document and in the external .js file.
The code I posted in post #2 works just fine for me in an external file.
You are obviously doing something wrong.
Are you sure that you have removed the HTML tags <script> and </script> from the external file?
Place the call to the external file right in front of the </body> tag.