title: How to select <td> of the <table> with javascript?
body: <p>I know this is very easy question, but I couldn't find the answer anywhere. Only answers are the ones using jQuery, not pure JS. I've tried the code below and it doesn't work. I don't know why. </p>
  
  <pre><code>var t = document.getElementById("table"),
      d = t.getElementsByTagName("tr"),
      r = d.getElementsByTagName("td");
  </code></pre>
  
  <p>This also doesn't work:</p>
  
  <pre><code>var t = document.getElementById("table"),
      d = t.getElementsByTagName("tr"),
      r = d.childNodes;
  </code></pre>
  
  <p>What am I doing wrong? What is the best way to do this?</p>
  
  <p>EDIT:
  I indeed have the id of my table table. Preety silly I know. This is how my HTML looks:</p>
  
  <pre><code>&lt;table id="table"&gt;
              &lt;tr&gt;
                  &lt;td id="c1"&gt;1&lt;/td&gt;
                  &lt;td id="c2"&gt;2&lt;/td&gt;
                  &lt;td id="c3"&gt;3&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td id="b1"&gt;4&lt;/td&gt;
                  &lt;td id="b2"&gt;5&lt;/td&gt;
                  &lt;td id="b3"&gt;6&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td id="a1"&gt;7&lt;/td&gt;
                  &lt;td id="a2"&gt;8&lt;/td&gt;
                  &lt;td id="a3"&gt;9&lt;/td&gt;
              &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>To explain my intentions more clearly > I wish to make a tic tac toe game. For starters, I wish to click on the &lt; td > and be able extract the id of that particular &lt; td >. How to do it most efficiently?</p>