1、window.clipboardData.setData

function copy_clip(text)
{
  <!--[if IE]>
    window.clipboardData.setData("Text", text);
    return;//return false;
  <![endif]-->
 
  //do Mozilla or Cross-Browser clipboard copy here.
}

<script type="text/javascript">
    <!--
    function clip(text){
    str=eval("document." + text)
    str.select()
    str = document.selection.createRange();
    window.clipboardData.setData('text',(str.text));
    }
    //-->
    </script>
    <form name="form">
    <a href="javascript:clip('form.copy')">
    复制到剪贴板</a><br>
    <textarea rows="16" cols="40" name="copy"></textarea>
    </form>

2、execCommand

<textarea )>   

相关文章:

  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2022-01-03
  • 2022-12-23
猜你喜欢
  • 2021-12-07
  • 2021-07-25
  • 2022-03-01
  • 2021-06-13
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案