Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anchors
Message
De
20/02/2003 07:26:14
 
 
À
20/02/2003 02:50:45
Information générale
Forum:
Internet
Catégorie:
Javascript
Titre:
Divers
Thread ID:
00755363
Message ID:
00755434
Vues:
13
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform