title: Selecting Table Cells so it changes background color
body: <p>I am trying to click on each cell on the table so that the selected cells I  click on change the background color from white to gray.  I am also trying to make it like a toggle so if I click on the cell again the background changes from gray to white, but it is not doing anything. I found a similar question, but the answer was advanced coding.  I want to create a simpler code. I checked Firebug, but I do not see any errors. I would appreciate any suggestions.  I am new to Javascript. </p>
  
  <p><a href="http://jsfiddle.net/RE006/nyzswnx2/1/" rel="nofollow noreferrer">http://jsfiddle.net/RE006/nyzswnx2/1/</a></p>
  
  <p>HTML5:</p>
  
  <pre><code>&lt;table class="bingo"&gt;
      &lt;tr&gt;
          &lt;td id="square0"&gt;&lt;/td&gt;
          &lt;td id="square1"&gt;&lt;/td&gt;
          &lt;td id="square2"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td id="square3"&gt;&lt;/td&gt;
          &lt;td id="square4"&gt;&lt;/td&gt;
          &lt;td id="square5"&gt;&lt;/td&gt;
  
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td id="square6"&gt;&lt;/td&gt;
          &lt;td id="square7"&gt;&lt;/td&gt;
          &lt;td id="square8"&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>JS:  </p>
  
  <pre><code>var toggleHighlight = function () {
      document.td.style.backgroundColor = "#cecece;"
  }
  
  window.onload = function () {
     getElementsByTagName("td").onclick = toggleHighlight ();
  } 
  </code></pre>