Javascript href link counter
<p>I need to make a button that increments and decrements a variable. When you click a link it increments a variable in the link href.When you click another link it decrements a variable in the link href.The variable can only go up to the last number in a specified array.PHP will be embedded around it. Any ideas?</p>

<pre><code>&lt;script type="text/javascript"&gt;
var counter = 0;
document.write('&lt;button onclick="counter++"&gt;Increment&lt;/button&gt;');
document.write(counter);
&lt;/script&gt;
</code></pre>

<p>This is an abomination I know, and it uses a button.</p>
