Zeroclipboard not copying on first Click
<p>I have the code and it is not working on first click, but on the second click it is working.</p>

<pre><code>$("#btnCopiar").on("click",function(){
        var clipBoardObj = new ZeroClipboard($("#btnCopiar"), {
              moviePath: "../thirdparty/ZeroClipboard.swf"
        });;
        // Create your data here to copy to the clipboard and assign to a variable name data 
         var data =   "DATA IS COMING FROM SERVER OT TEXT INPUT";
                clipBoardObj.on("copy", function (event) {                  
                var clipboard = event.clipboardData;
                  clipboard.setData( "text/plain", data );
        });

    });

&lt;button id="btnCopiar"&gt;Copiar&lt;/button&gt;
</code></pre>

<p>Even if I have initialized the clipboard outside the click event, it is not working </p>