how to get value of cell in table and display it in textbox : <p>I have a table like this:</p>

<pre><code>&lt;table id="mytable"&gt;
  &lt;tr&gt;
    &lt;th&gt;Customer Id&lt;/th&gt;
    &lt;th&gt;Name&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;123&lt;/td&gt;
    &lt;td&gt;A&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;456&lt;/td&gt;
    &lt;td&gt;B&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td&gt;789&lt;/td&gt;
    &lt;td&gt;C&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;form&gt;
    &lt;input type="text" name="txtDsCode" id="txtDsCode"/&gt;
&lt;/form&gt;
</code></pre>

<p>When I click on the <code>textbox</code> and then click on the <code>cell</code> in the table , the value of the cell will display in the <code>textbox</code>.
How should i do it with javascript?
Thanks all!</p>
