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>

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

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

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

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

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

<div id="demo">This text will be coppied</div>

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

  permissionAlert: "when needed"

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

  permissionAlert: "when needed"

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

  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.