Cut Copy JavaScript Library
First, include the script located on the source folder.
<script src="cliptoast.js"></script>
Now, you need to instantiate it. This selector corresponds to the trigger:
<a class="button" href="#">Copy</a>
new ClipToast(".button");
<!-- Target -->
<textarea id="foo">Duis aute irure dolor in reprehenderit</textarea>
<!-- Trigger -->
<a class="button" data-cliptoast-action="cut" data-cliptoast-target="#foo">
Cut to clipboard
</a>