Menu
Is it possible in Javascript to refer and change the links without referring to document.links array.
For example:
Step 1:
document.write(‘<a href=”sth.htm”>Click me !!!</a>’);
Step 2:
When someone clicks on an image the links attribute href changes to “bye.htm”. I wouldn’t like to use the following code:
document.links[0].href=”bye.htm”
How can I refer to the link with a name instead of links array.
For example:
document.mylink.href=”bye.htm”;