Tôi là Duyệt

copy.js - simple copy text to clipboard in the browser

Simple copy to clipboard. No Flash.


You can get it on bower.

bower install copy --save

Or npm, too.

npm install copy-js --save

If you’re not into package management, just [download a ZIP] file.


First, include the script located on the dist folder.

<script src="dist/copy.min.js"></script>

Or load it from CDN provider.

<script src="//cdn.rawgit.com/duyetdev/copy.js/master/dist/copy.min.js"></script>


Just copy:

copy('hello world.');

With callback:

copy('hello world', function(err) {
 if (err) console.log('Some thing went wrong!');


That’s it!

Visit project source code here: https://github.com/duyet/copy.js