现在有个lable1.text显示的是一个网址    右边放个复制按钮   点击按钮复制lable1.text的值

解决方案 »

  1.   

    window.clipboardData.setData("Text",a.value)
      

  2.   

    window.clipboardData.setData("Text",document.getElementById('<%=this.lable1.ClientID %>').innerText)
      

  3.   

     [code=HTML][<asp:Label ID="Label1" runat="server" Text="www.sina.com"></asp:Label> <input type="button" onclick="CopyText()" value="copy"/>
     function CopyText()
        {
            window.clipboardData.setData("Text",document.getElementById("<%=this.Label1.ClientID %>").innerText);
            alert("复制成功");
        }
    /code]