Clipboard.js – Free Js Library for Copying Text to Clipboard

clp2

Users often rely on copy/paste to fill out form fields or rearrange content on a dynamic website. Clipboard.js is a brand new library that’s completely free for any web project.

Some developers use the auto-copy feature which copies text whenever a user selects a field. This can be useful for copying generated links or blocks of code from a tutorial.

The best part of clipboard.js is that it has no dependencies for its use. Of course you can run something like jQuery in the background, however you don’t need to.

clp

To install the library just add clipboard.min.js into your website’s header. Then using the clipboard.js methods you can easily target a certain element on the page for auto-copying features, or anything else of similar relevance.

This will run in all major browsers except Safari, for some reason. It includes support for IE9+ and has some great documentation on the clipboard.js project page.

If you’re interested you can download the file directly from GitHub and start playing around within minutes. The file is only 2KB and offers an incredible amount of functionality for in-browser clipboard management.

The post JavaScript Library for Copying Text & Clipboard Management appeared first on webdesignledger