Posts

Showing posts from 2015
Copy to clipboard using Zeroclipboard and jquery The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible  Adobe Flash  movie and a  JavaScript  interface. The "Zero" signifies that the library is invisible and the user interface is left entirely up to you. This is achieved by automatically floating the invisible movie on top of a   DOM   element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mousedown effects.      The zeroclipboard cdn you can find from  here   The script.      $(document).ready(function () { $("#btnCopy").click(function () {  var clip = new ZeroClipboard($("#btnCopy"), { moviePath: "http://davidwalsh.name/demo/ZeroClipboard.swf" }); clip.setText($("#spn").text());     }); }); The html.        <span id="spn">hi</span>   <input type="button" id="btnCop