How to developed Copy to Clipboard using ZeroClipboard

1. Download ZeroClipboard Flash file(ZeroClipboard.swf) and Javascript file(ZeroClipboard.js) from this link :

2. Now initialize ZeroClipboard scripts

 <script type="text/javascript" src="js/ZeroClipboard.js"></script>
 <script type="text/javascript">
    function initialize() {
        clip = new ZeroClipboard.Client();
        clip.addEventListener('mousedown', function() {
        clip.addEventListener('complete', function(client, text) {
            alert('copied: ' + text);
        //glue it to the button
    jQuery('document').ready(function() {
        var clip = null;

3. Now Active copy to clipboard functionality to a html anchor link

     <input readonly="true" type="text" id="Link" value=""/>
  <a id='copy' >Copy To Clipboard</a>	


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s