jQuery Clipboard Copy

…衆ロ難τιáo~ 提交于 2019-12-06 09:18:15

问题


I need Clipboard Copy functionality, even i m taking help from http://plugins.jquery.com/project/copy link but it is not working fine.

<li>
     <label class="FieldName">
       Url:
     </label>
     <a id="url" href="<%=Model.FinalPacketUrl %>" target="_blank">
        <%=Model.FinalUrl %></a> </li>
 <li>
     <label class="FieldName">
      Password:
     </label>
 <span id="pwd">
    <%=Model.FinalPassword %></span> </li>

This is my Jquery code.This is just only copy text not text value

  function CopyToClipboard() {
    var text = $("#url").attr("href") + "\n" + $("#pwd").html();
           $.copy(text);
        }

Please help me to fix this problem


回答1:


You may want to try the following plugin:

http://plugins.jquery.com/project/clipboard



来源:https://stackoverflow.com/questions/2069663/jquery-clipboard-copy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!