<td>
<input type=text name="iphone" onfocus="javascript:this.form.iphone.value=this.form.iphone.name"></td>
<td><input type=text name="address" onfocus="javascript:this.form.address.value=this.form.address.name"></td>

解决方案 »

  1.   

    <body onclick="if(event.srcElement.tagName=='INPUT') alert(event.srcElement.name)">
      

  2.   

    只有一个表单时
    <form >
    <td>
    <input type=text name="iphone" onfocus="javascript:this.form.iphone.value=this.form.iphone.name"></td>
    <td><input type=text name="address" onfocus="javascript:this.form.address.value=this.form.address.name"></td>
    </form>
    存在多个表单时
    <form name="form1">
    <td>
    <input type=text name="iphone" onfocus="javascript:document.form1.iphone.value=document.form1.iphone.name"></td>
    <td><input type=text name="address" onfocus="javascript:document.form1.address.value=document.form1.address.name"></td>
    </form>