# clipboard.js [![Build Status](http://img.shields.io/travis/zenorocha/clipboard.js/master.svg?style=flat)](https://travis-ci.org/zenorocha/clipboard.js) ![Killing Flash](https://img.shields.io/badge/killing-flash-brightgreen.svg?style=flat) > Modern copy to clipboard. No Flash. Just 2kb Demo ## Why Copying text to the clipboard shouldn't be hard. It shouldn't require dozens of steps to configure or hundreds of KBs to load. But most of all, it shouldn't depend on Flash or any bloated framework. That's why clipboard.js exists. ## Install You can get it on npm. ``` npm install clipboard --save ``` Or bower, too. ``` bower install clipboard --save ``` If you're not into package management, just [download a ZIP](https://github.com/zenorocha/clipboard.js/archive/master.zip) file. ## Setup First, include the script located on the `dist` folder. ```html ``` Or load it from a CDN. ```html ``` Now, you need to instantiate it using a DOM selector. This selector corresponds to the trigger element(s), for example ` ``` ### Cut text from another element Additionally, you can define a `data-clipboard-action` attribute to specify if you want to either `copy` or `cut` content. If you omit this attribute, `copy` will be used by default. example-3 ```html ``` As you may expect, the `cut` action only works on `` or `