https://github.com/milankyncl/jquery-copy-to-clipboard
Copy to clipboard jQuery plugin.
https://github.com/milankyncl/jquery-copy-to-clipboard
Last synced: 5 months ago
JSON representation
Copy to clipboard jQuery plugin.
- Host: GitHub
- URL: https://github.com/milankyncl/jquery-copy-to-clipboard
- Owner: milankyncl
- License: other
- Created: 2016-04-15T14:12:57.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-10-27T16:03:24.000Z (over 4 years ago)
- Last Synced: 2023-03-10T12:40:41.614Z (about 2 years ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 16
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jQuery - Copy to clipboard Plugin
================jQuery Copy to clipboard plugin - copy any text to the user site's clipboard. Operates on the basis of creating hidden text field and executing "copy" command.
You can see [DEMO](https://milankyncl.github.io/jquery-copy-to-clipboard/) page.
## Usage
### 1. Including jQuery
Be sure you have jQuery included in your website.
```html
```
### 2. Include CopyToClipboard jQuery extension
```html
```
### 3. Run CopyToClipboard function
Works on any kind of element.
There are three ways to use this plugin.
- 1. Apply CopyToClipboard plugin with a JS Code.
```javascript
$(document).ready(function() {
$('.element').CopyToClipboard();
});
```- 2. Add data-clipboard attribute to any HTML element, executes on click.
```html
Copy me!
```- 3. or with jQuery selector...
```html
Copy another element's value!
```### 4. More information
jQuery CopyToClipboard is based on creating hidden text field, inserting text and executing "copy" command.