Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to enable /disable the link
Message
De
28/03/2012 12:20:37
 
 
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01539560
Message ID:
01539580
Vues:
60
This message has been marked as a message which has helped to the initial question of the thread.
>What do you mean by changing the attribute? Can you show some code samples?

You can define your tag like this:
<A HREF=http://www.levelextreme.com ID=AUniversalThread>
Then, you can establish an object reference to it like this:
loA=document.getElementById("AUniversalThread")
Then, you can access its properties like this:
loA.href="http://www.google.com"
loA.target="_blank"
Some are listed here:

http://www.w3schools.com/jsref/dom_obj_anchor.asp

If you wish to add an attribute dynamically, you can do this:
loA.setAttribute("href", "http://www.google.com") 
Or, to go with the style by the use of the class name:
loA.style.className="StyleYouWishToUseToChangeTheLookOfYourAHRefTag"
Here is another useful link:

http://www.coursesweb.net/javascript/getelementbyid

So, basically, based on the logic of your Web, or from an event of a tag, such as onclick() or else, you can call a javascript function which will issue some of the above lines.Then, if you manipulate the change of the class, then the CSS does the rest, assuming you have a style with everything you wish your A tag to look like such as Color, Visibility, fontWeight, Text-Decoration, etc.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform