Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to copy text to Clipboard using jQuery

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 530
    Comment on it

    Hello Readers,

    I will show you how to copy text in clipboard without using ctrl+c.

    <html>
      <head>
     <script type="text/javascript" src="jquery-1.8.0.min.js"></script> 
    <script src="jquery.zclip.js"></script>
    <script>
        $(document).ready(function(){
            $("a#copy").zclip({
               path:"ZeroClipboard.swf",
               copy:function(){
               return $("input#dynamic").val();
               }
            });
        });
    </script>
      </head>
      <body>
    <input type="text" id="dynamic" value="clipboard" />
    <a href="#copy" id="copy">Copy Now</a>
    </body>
    </html>
    

    Here, the above code shows how to copy text using jquery. In this code we used jquery function, flash and the zclip clipboard plugin to perform this task.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: