Javascript set variable with onclick
<p>I am working on a dynamic bingo game that randomly generates the number in each bingo square and when you click on a square it will change color.  This I have accomplished.  I created a table and within each TD I have the following code:</p>

<pre><code> &lt;td onclick="javascript:this.style.background = '#00ff00';"    
 id="B1" class="bingo1"&gt;&lt;script&gt;document.write(patty[0]);&lt;/script&gt;&lt;/td&gt;
</code></pre>

<p>When the page is loaded each square (td) will have a variable that is initially set to 0 (var B1 = 0;).  When you click in the square the variable is increased to 1, but I have no idea how to do this.  I thought that maybe it could be done with the onclick event or maybe it would detect when the background color changes.  But, as I said, I have no idea how to do either of these.  Any and all help would be greatly appreciated.  Thanks!</p>

<ul>
<li>Each square will have a different id, such as B2, B3, B4, B5, I1, I2, etc.</li>
</ul>

<p>Take care and have a great day....</p>

<p>ciao,
john.</p>
