>How to change the color of a link by clicking on it using javascript functions.Are there any specific objects or properties.Please give an example code
One way of modifying the colors of a link is through CSS in the header section of the HTML file.
<style type="text/css">
A:link {
color: #0000FF;
}
A:visited
{
color: #00FF00;
}
A:active
{
color: #FF0000;
}
A:hover
{
color: #FF00FF;
}
</style>
The link color is the initial colour, once clicked on the colour will change to the visited colour. The active color is used if the link is the active element on the page (eg right click) & the hover color is used when the mouse is above the link. (See
http://www.w3.org/TR/REC-CSS2/selector.html#x36)
AFAIK, the link colors are global to an individual HTML page, they can't be changed individually, I might be wrong but I haven't seen references to changing individual link colors.
The relevant attributes are :
document.linkColor
document.vlinkColor
document.alinkColor
I haven't found an attribute for hovering.
Len Speed