Registering clicks on a button
<p>I have created a button in JavaScript with the following details:</p>

<pre><code>&lt;td id='2,A,B,C' onclick='enterKey(this.id)'&gt;2&lt;/td&gt;
</code></pre>

<p>When the JS is passed through the function an array is created:</p>

<pre><code>string = string.split(',')
</code></pre>

<p>meaning string[0] is 2, string[1] is A and henceforth....</p>

<p>The question I wanted to ask is how do I get JS to register multiple presses on the button.</p>

<p>So if the user presses the  twice - they get A instead of 2. If they press it three times - they get B. But if they press is 5 times - it reverts back to 2.</p>

<p>Any advice on how I can achieve this? Many thanks in advance!</p>
