日期:2014-05-16 浏览次数:20310 次
<script> function change(td){ var html="<input name='' id='' value='$'/>"; td.innerHTML=html.replace("$",td.innerHTML); td.getElementsByTagName("input")[0].focus(); td.onclick=null; td.getElementsByTagName("input")[0].onblur=function(){ td.innerHTML=this.value; td.onclick=function(){change(this)}; } } </script> <table> <tr> <td onclick="change(this)">21314asdfaf</td> </tr> <tr> <td onclick="change(this)">21314asdfaf</td> </tr> </table>