diff --git a/README.md b/README.md index 7336628..db49303 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # clipboard.js -> A modern approach to copy & cut to the clipboard. No Flash. No dependencies. Just 2kb. +> A modern approach to copy text to the clipboard. No Flash. No dependencies. Just 2kb. Demo @@ -10,8 +10,6 @@ Copy text to the clipboard shouldn't be hard. It shouldn't require dozens of ste That's why clipboard.js exists. -And don't be a jerk, use it responsibly :) - ## Install You can get it on npm. @@ -36,36 +34,27 @@ First, include the script located on the `dist` folder ``` -Now, you need to instantiate it using a DOM selector. This selector corresponds to the trigger element, i.e. ` -``` - ### Copy text from another element -Alternatively, you can copy content from another element by adding a `data-target` attribute in your trigger element. +A pretty common use case is to copy content from another element. You can do that by adding a `data-target` attribute in your trigger element. The value you include on this attribute needs to match another's element `id` attribute. -example-2 +example-2 ```html @@ -83,7 +72,7 @@ Additionally, you can define a `data-action` attribute to specify if you want to If you omit this attribute, `copy` will be used by default. -example-3 +example-3 ```html @@ -97,42 +86,58 @@ If you omit this attribute, `copy` will be used by default. As you may expect, the `cut` action only works on `` or `