[Javascript] refreshing the score

Peter-Paul Koch gassinaumasis at hotmail.com
Mon May 7 03:33:19 CDT 2001



>I am developping a simple yes/no game and would like to show the vsitor 
>his/her score every time he/she clicks on an radio type button without 
>having to reload the page.
>
>I have a counter variable which is increased if the answer is correct but 
>don't know how to refresh the part of the page where this counter is 
>written automatically.

Put it in a form field:

<INPUT NAME="the_score">

document.forms[0].the_score.value = counter;

Or you can write it into a layer. See 
http://www.xs4all.nl/~ppk/js/index.html?layerwrite.html for the code you 
need.

ppk

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





More information about the Javascript mailing list