how to change td color, by click on the td(like battleship game)?
<p>how to change td color, by click on the td(like battleship game)? 
here is the code'with specific id :</p>

<pre><code>str +="&lt;td id='" + counter + "' onclick='checkClick(" + counter + "," + i + "," + j + ")' style = 'background-color: Black; height:30px; width:30px'&gt;";
</code></pre>

<p>(the str in the end will be use with innerHTML that will update this on div inside the body</p>

<p>the checkClick function need to change it , i tried with innerHTML or to get the td by ElementID and it didnt work</p>
