copy paste select jqlipboard - Free Download jQuery Plugin To Copy/Paste/Select Text - jQlipboard

Free Download jQuery Plugin To Copy/Paste/Select Text – jQlipboard

Posted on

This time I will share jQuery Plugin and tutorial about jQuery Plugin To Copy/Paste/Select Text – jQlipboard, hope it will help you in programming stack.

copy paste select jqlipboard - Free Download jQuery Plugin To Copy/Paste/Select Text - jQlipboard
File Size: 8.24 KB
Views Total: 717
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

jQlipboard is a simple jQuery clipboard plugin for handling copy, paste, and select (highlight) events on the web app.

How to use it:

1. Load the main script JQlipboard.js after jQuery.

1 <script src="/path/to/cdn/jquery.slim.min.js"></script>
2 <script src="/path/to/JQlipboard.js"></script>

2. Copy any string to the clipboard.

1 $.copy("Any String Here");

3. Or copy text within a container element.

1 <div id="demo">This text will be coppied</div>
1 $('#demo').copy();

4. Or copy text you typed in a text field.

01 <!-- Input Field -->
02 <input type="text" id="demo" />
03  
04 <!-- Or Textarea -->
05 <textarea id="demo">
06   ...
07 </textarea>
08  
09 <!-- Copy Button -->
10 <button id="myBtn">Click Me To Copy</button>
1 $("#myBtn").click(function(){
2   var str = $("#demo").val();
3   $.copy(str)
4 });

5. It also provides a functionality to select & highlight text within a container element.

1 <div id="demo">This text will be coppied</div>
1 $('#demo').select();

6. Determine when the page will request permession to use the clipboard:

  • when needed (default)
  • immediate
1 $.jQlipboard({
2   permissionPrompt: "when needed"
3 })

7. Determine when the page will alert the user that they have not given their permission to access the clipboard:

  • when needed (default)
  • immediate
  • never
1 $.jQlipboard({
2   permissionAlert: "when needed"
3 })

8. Determine whether to detect when you modify the clipboard on your own and to adjust the functions accordingly. Default: false.

1 $.jQlipboard({
2   copyListener: true
3 })

Changelog:

2021-03-20

  • Better use of jQuery

2020-11-15

  • Improvement

2020-11-02

  • Cleanup JS.

2020-10-31