...

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



zinester
09-23-2005, 10: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:

http://textzi.net/test

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:

http://textzi.net/test2

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

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

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

using

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

zinester
09-24-2005, 01: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?

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

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

zinester
09-24-2005, 03:28 AM
thanks, CrAzY_J.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum