Press "Enter" to skip to content

Select/Copy Text Using JavaScript or jQuery | jQlipboard

jQlipboard is a JS/jQuery extension that makes accessing the clipboard much easier. This plugin also has features that make it usable across most if not all browsers.

jQlipboard is a simple jQuery Clipboard plugin for handling copy-paste and highlighting events on the web application.

How to make use of it:

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

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

2. Copy any string to the clipboard.

$.copy("Any String Here");

3. Copy the text inside a container component.

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

4. Copy the text you typed in a text field.

<!-- Input Field -->
<input type="text" id="demo" />

<!-- Or Textarea -->
<textarea id="demo">
  ...
</textarea>

<!-- Copy Button -->
<button id="myBtn">Click Me To Copy</button>
$("#myBtn").click(function(){
  var str = $("#demo").val();
  $.copy(str)
});

5. It additionally offers functionality to select & highlight text within a container component.

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

6. Determine when the web page will request permission to make use of the clipboard:

$.jQlipboard({
  permissionAlert: "when needed"
})

7. Determine when the web page will alert the user that they haven’t given their permission to access the clipboard:

$.jQlipboard({
  permissionAlert: "when needed"
})

8. Determine whether or not to detect if you modify the clipboard on your own and to adjust the features accordingly.

$.jQlipboard({
  copyListener: true
})

jQuery Plugin To Copy/Paste/Select Text, copy to clipboard javascript, jQlipboard Plugin/Github


See Demo And Download

Official Website(DiriectorDoc): Click Here

This superior jQuery/javascript plugin is developed by DiriectorDoc. For extra Advanced Usages, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published.