View Full Version : show a user how many times s/he has clicked a hyperlink

09-23-2005, 09:09 PM
I'm looking for a way to show a user how many times (modulo 4) s/he has clicked on a certain hyperlink. Like this:


I would like to get rid of the frames set up and just change the the [n] that's on the left frame.

The only way I can think of doing this is using document.write and rewrite everything. Like this:


Is there a simpler way of doing this, without having to rewrite everything? I just want to change the [n]....

09-23-2005, 10:20 PM
You can update the content of

<span id="myid"></span>


document.getElementById('myid').innerHTML = 'new content';

09-24-2005, 12:09 AM
thanks for this felgall!
it works wonders. :thumbsup:

i have to ask, because i can't find 'getElementById' in my javascript book... where does it come from?

09-24-2005, 01:32 AM
Here's a tutorial on it if that's what you wanted.

Click (http://expertsonline.pixeldepth.net/tutorials/javascript/1126557727/?PHPSESSID=1eab70aafbe9f1ec87d36dded8041766)

09-24-2005, 02:28 AM
thanks, CrAzY_J.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum