JSFiddle - React, Tailwind, and code Playground

by Can

HTML

<script src="http://www.steamdev.com/zclip/js/jquery.zclip.min.js"></script>
<p id="description">zClip is a lightweight jQuery "copy to clipboard" plugin built using the
    popular Zero Clipboard library. This plugin uses an invisible Adobe Flash
    movie that is fully compatible with Flash Player 10 and below.</p>
<a href="#"
id="copy-description">Click here to copy - paragraph</a>

<br>
<br>
<br>
<a href="#" id="copy-dynamic">Click here to copy - dynamic</a>

<br>
<br>
<input id="dynamic" type="text" placeholder="type anything here">

JavaScript

$('a#copy-description').zclip({
    path: 'http://www.steamdev.com/zclip/js/ZeroClipboard.swf',
    copy: $('p#description').text()
});

// The link with ID "copy-description" will copy
// the text of the paragraph with ID "description"


$('a#copy-dynamic').zclip({
    path: 'http://www.steamdev.com/zclip/js/ZeroClipboard.swf',
    copy: function () {
        return $('input#dynamic').val();
    }
});