JavaScript - Dynamically Changing Links
HomeHTAJScriptJavaScriptPHP
Main Menu Home HTA JavaScript JScript PHP Examples Dynamically Creating Tables Dynamically Chaning Links Script Box Wormbites 2006 Includables ezCalendar getOrdinalFor(...) jPaq Other Libraries jQuery Prototype script.aculo.us

The links below this paragraph illustrate one way to dynamically change a link's text and address to which it points.  First, the getElementById method is used to get a reference to the link that was clicked on.  Next, it is determined how to act based on values kept either in the text or in the link (href property) itself.  Then the href may be changed to the appropriate value and the innerHTML property is modified to change the link's text.  Please feel free to check out the source code to see what is going on under the hood.

Click me, but be warned that I have a click limit of 3 times.
Click me, but be warned that I have a click limit of 5 times.
Click me, but be warned that I have a click limit of 10 times.
Click me to turn me on!!!

Related Search Results

  1. From JScript Arrays To VB Arrays:
    Learn how to convert from a JScript or JavaScript array to a VBArray.
  2. Triangle Solitaire:
    Play the peg game, Triangle Solitaire.
  3. Validation Using JavaScript:
    Learn how to do data validation with JavaScript.
  4. JXtension - A Small, Yet Powerful JavaScript Library:
    JXtension is a small, yet powerful JavaScript library.
  5. Wormbites 2008 (Desktop Version):
    The ultimate Snake game with multiple brain-teasing levels. You can also custom design you own levels.