sunxi

<%--复制粘贴功能--%>

<script type="text/javascript">
    function contentCopy() {
        //获取到对象
        var obj = document.getElementById("contentId");
        //选择文本框中得所以内容
        obj.select();
        //执行复制功能
        document.execCommand("copy");
    }
 </script>


<div id="tg" style="float: left; background-color: #E4E4E4; width: 779px; height: 23px;">
    &nbsp;推荐地址:&nbsp;&nbsp;
    <input type="text" name="content" id="contentId"
        value="http://www.jiajin.com/personal/register.aspx" size="40" />
  &nbsp;<input type="button" name="allCopy" value="复制"
   onClick="contentCopy()" />
    </div>

分类:

技术点:

相关文章: