title: How to use SweetAlert with clipboard.js library?
body: <p>I'm trying to use <a href="http://t4t5.github.io/sweetalert/" rel="nofollow noreferrer">SweetAlert</a> with the <a href="https://clipboardjs.com/" rel="nofollow noreferrer">clipboard.js</a> library.
  I have tried simulating a click on a HTML button when the user confirm on SweetAlert, but it didn't work.</p>
  
  <p>Here is what I've tried to do:</p>
  
  <p><strong>My HTML:</strong></p>
  
  <pre><code>&lt;button class="btn btn-primary" id="copyBtn" data-clipboard-target="#info_block" onclick="copyText();"&gt;
      Copy Text!
  &lt;/button&gt;
  
  &lt;div id="info_block" name="info_block"&gt;
      Some example text.
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>My JavaScript function:</strong></p>
  
  <pre><code>var clipboard = new Clipboard('.btn');
  clipboard.on('success', function(e) {
      console.log(e);
  });
  clipboard.on('error', function(e) {
      console.log(e);
  });
  </code></pre>
  
  <p><strong>And the structure of my SweetAlert:</strong></p>
  
  <pre><code>swal({
    title: "Copy the text?",
    text: "Are you sure you want to copy it to clipboard?",
    type: "warning",
    showCancelButton: true,
    confirmButtonColor: "#DD6B55",
    confirmButtonText: "Yes, copy it!",
    closeOnConfirm: false
  },
  function(){
    $("#copyBtn").click(); // simulates click on html button.
    swal("Copied!", "The text has been copied.", "success");
  });
  </code></pre>
  
  <p>It works fine without sweet alert, but it won't work simulating a click on the copy button, and I can't figure out a way to get it working.</p>