Jqery plugin clipboard.js----A modern way to copy text to the Clipboard

Source: Internet
Author: User

###

Before using the JS-Clipboarddata object of the Clipboard object can be implemented to achieve paste replication, but the kind of only support ie.

To find the JQ of a plug-in Zclip, but the online statement is the use of flesh to achieve, I use the later can be achieved, but the face of my self AH table in the TD there are many to achieve paste replication, there will be problems.

So, just find another plug-in of this jqery now, relatively better, can support the mobile side of the

###

Plugin website: https://clipboardjs.com/

And it's easy to implement.

I'll just get an example:

<! DOCTYPE html><input id= "foo" type= "text" value= "Hello" > <button class= "btn" data-clipboard-action= "Copy" Data-clipboa rd-target= "#foo" >Copy</button><!--2. Include Library--<script src= ". /dist/clipboard.min.js "></script><!--3. Instantiate clipboard--<script>    varClipboard =NewClipboard ('. btn ')); Clipboard.on (' Success ',function(e) {console.log (e);    }); Clipboard.on (' Error ',function(e) {console.log (e);    }); </script></body>

Jqery plugin clipboard.js----A modern way to copy text to the Clipboard

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.