Hello…
I am trying to figure out how to change text on my page after an onclick event occurs.
I am tracking a variable, lets say myVar, that when a certain button is clicked it updates the variable and then updates some text on the page. I don’t use JS very much, but this looks like the best way to do it with my setup; however I am open to any suggestions.
Right now I have this function for tracking when an item is clicked. The alert is just for testing purposes to make sure its tracking.
var tpoints = 40;
var dpoints = 0;
function adjustPoints()
{
tpoints--;
dpoints++;
alert('tpoints: ' + tpoints);
return false;
}
Here is my link that I am counting clicks:
<a href="#" onmouseover="ajax_showTooltip(window.event,'../tooltip/poll.php?n=<?php echo $ttable[$ttier][$tcolumn];?>',this);return false" onmouseout="ajax_hideTooltip()">
and then I want to display my JS variable tpoints at some point in the page but keep it updated as the link is clicked.
Any thoughts into the best way to accomplish this?