<SCRIPT LANGUAGE="JScript">
function doufucopy() {
textRange = test.createTextRange();
textRange.execCommand("Copy");
}
function doufupaste() {
textRange = taCode.createTextRange();
textRange.execCommand("Paste");
}
-->
</SCRIPT>
测试<input type=text ID="test">
<input type=button value="复制" onclick="doufucopy();">
<input type=button value="粘贴" onclick="doufucopy();">

解决方案 »

  1.   

    taCode没有加,可以加一个id为taCode的文本框
      

  2.   

    <script language=javascript>
    var str = "meizz";
    window.clipboardData.setData("Text", str);
    </script>
    你再粘贴一下,看看剪贴板里是不是你所要的内容呢?
      

  3.   

    <script language=javascript>
    var str = "meizz";
    window.clipboardData.setData("Text", str);
    alert("你剪贴板里的内容是 :"+ window.clipboardData.getData("Text"));
    </script>
    你再粘贴一下,看看剪贴板里是不是你所要的内容呢?window.clipboardData.setData("Text","你的内容"); //往剪贴板里写东西
    window.clipboardData.getData("Text");  // 可以获得剪贴版的文字