Tag: clipboard.js
<script src="dist/clipboard.min.js"></script>
<script>
var clipboard = new Clipboard('.btn');
</script>
<!-- Target -->
<input id="foo" value="https://github.com/zenorocha/clipboard.js.git">
<!-- Trigger -->
<button class="btn" data-clipboard-target="#foo">
<img src="assets/clippy.svg" alt="Copy to clipboard">
</button>
<!-- Trigger -->
<button class="btn" data-clipboard-text="Just because you can doesn't mean you should — clipboard.js">
Copy to clipboard
</button>
var clipboard = new Clipboard('#d_clip_button');
clipboard.on('success', function(e) {
e.clearSelection();
});