How to get <td> value in textbox
<p>I've done some code in html and in JavaScript ... My query is when I click on <code>&lt;td&gt;</code>, whatever the value associated with it, has to be displayed in the corresponding text box ... 
In front of <code>&lt;td&gt;</code> I've taken the textbox ... for an example I've taken 3 <code>&lt;td&gt;</code> and 3 textboxes </p>

<pre><code>       &lt;script type="text/javascript"&gt;
       function click3(x) {
       x = document.getElementById("name").innerHTML
       var a = document.getElementById("txt"); 
       a.value = x; 
       }
       function click1(y) {
       y = document.getElementById("addr").innerHTML
       var b = document.getElementById("txt1");
       b.value = y;
       }
       function click2(z) {
       z = document.getElementById("email").innerHTML
       var c = document.getElementById("txt2");
       c.value = z;
         }
       &lt;/script&gt;
</code></pre>

<p>this is my JavaScript code , I know this is not an adequate way to deal such problem, since its giving static way to deal with this problem 
does anyone have a better solution for this problem ??
In JavaScript/jQuery </p>
