CopyJS is a lightweight JavaScript library that allows you to copy plain text or HTML content to the clipboard.
Must Read: Tiny Library for Copy Text In Clipboard | CopyClipboardJs
How to make use of it:
1. Import the CopyJS
library into the document.
<script src="copy.min.js"></script>
2. Copy plain text to the clipboard.
copyjs("Text to copy", { // options here });
3. Copy the HTML content to the clipboard.
copyjs('<h1 style="color:red;">Hello, world!</h1>', { html: true });
4. Copy content from a delimiter.
copyjs("#text", { copyFromSelector: true, html: true });
5. Decide if you want to re-highlight what has been selected.
copyjs("#text", { copyFromSelector: true, html: true, reSelect: false, });
See Demo And Download

Official Website(codingjlu): Click Here
This superior jQuery/javascript plugin is developed by codingjlu. For extra Advanced usage, please go to the official website.