<input id="txt" onclick="lists.style.display=''">
<table border="0" style="display:none" id="lists" onclick="txt.value=event.srcElement.innerHTML;this.style.display='none'">
  <tr>
    <td>张三</td>
  </tr>
  <tr>
    <td>李四</td>
  </tr>
  <tr>
    <td>王五</td>
  </tr>
</table>

解决方案 »

  1.   

    一个值?
    你自己给td加上属性,例如<td a="xx" b="xx">
    在我的代码中,用event.srcElement.a/.b就可以得到这两个属性的值,想传多少个值都可以:)
      

  2.   

    <input id="txt" onclick="lists.style.display=''">
    <table border="0" style="display:none" id="lists" onclick="txt.value+=event.srcElement.innerHTML;this.style.display='none'">
      <tr>
        <td>张三</td>
      </tr>
      <tr>
        <td>李四</td>
      </tr>
      <tr>
        <td>王五</td>
      </tr>
    </table>这个就是我要的,谢谢大侠