Author: | spacetalehq |
---|---|
Views Total: | 369 views |
Official Page: | Go to website |
Last Update: | December 27, 2018 |
License: | MIT |
Preview:

Description:
Copyer.JS is a vanilla JavaScript library that has the ability to copy text within a container of an input field to the clipboard using the document.execCommand
API.
How to use it:
Import the JavaScript file copyer.js
into the document.
<script src="./src/copyer.js"></script>
Call the copyer()
function and specify the selector which holds the text you want to copy.
<p id="demo">CSSSCRIPT.COM</p> <input id="demo-2" type="text" placeholder="CSSSCRIPT.COM">
copyer("demo"); copyer("demo-2");