README
COPY IT
Small size copy to clipboard code. No Flash. Demo
Install
npm install copy-it-js --save
or
yarn add copy-it-js
How to use?
Example 1:
import { copyText } from 'copy-it-js';
copyText("Copy Me");
Example 2:
import { copyElement } from 'copy-it-js';
copyElement(document.getElementById('someInput'))
<html>
<head>...</head>
<body>
<input id="someInput" readonly value="copy me" />
</body>
</html>
Example 3:
<html>
<head>
<script src="../dist/copy.min.js"></script>
</head>
<body>
<input id="someInput" readonly value="copy me" />
<script>
copyit.copyElement(document.getElementById("someInput"));
</script>
</body>
</html>
Inspired From