sanni
::
首页
::
新随笔
:: ::
聚合
::
管理
UI-links
albinworld
brisy.xplore.cn
chinaui
eicostudio
jjying
rokey
UIgarden
UIRss
UItimes
平面广告设计
点击input后直接复制TD里的内容
这个代码,点击input后直接复制TD里的内容
<table border="1"> <tr> <td id="se1">aaaaaa</td> <td id="se2">bbbbbb</td> </tr> </table> <input type="button" onclick="select_all('se1')" value="a" /> <input type="button" onclick="select_all('se2')" value="b" /> <script language="JavaScript" type="text/javascript"> function select_all(obj_str){ var sel=document.body.createTextRange(); sel.moveToElementText(document.getElementById(obj_str)); sel.select(); document.execCommand("copy"); } </script>
提示:您可以先修改部分代码再运行
posted on 2007-08-12 18:34
sanni
阅读(564)
评论(0)
编辑
收藏
引用
所属分类:
JavaScript
只有注册用户
登录
后才能发表评论。