An open API service indexing awesome lists of open source software.

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.

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.