How to copy text to the client's clipboard using jQuery? [duplicate]

The workflow is simple:

  1. You click inside a textarea.
  2. The text is copied to the client's clipboard.
  3. Display notice to the user.

How do you do it?



Copying to the clipboard is a tricky task to do in Javascript in terms of browser compatibility. The best way to do it is using a small flash. It will work on every browser. You can check it in this article.

Here's how to do it for Internet Explorer:

function copy (str)
    //for IE ONLY!


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.