title: How to pass button into Jquery function?
body: <p>I'm using a third party jQuery library called jQquery.confirm. It provides dialogs in jQuery. Upon clicking a button of a particular class I want to use the <code>confirm()</code> function in order to bring up the confirmation:</p>
  
  <pre><code>$(".btn-danger").click(function(event) {
      //Prevent the button from being clicked.
      event.preventDefault();
  
      $.confirm({
          text: "Are you sure you want to delete that comment?",
          confirm: function() {
              //Code in here for button to be pressed
          }
      });
  });
  </code></pre>
  
  <p>The issue I'm having is with the <code>confirm: function()</code>. I'd like to simply simulate clicking the button here. I've tried this but it doesn't seem to recognize the button that I need to click:</p>
  
  <pre><code>$(this).trigger("click");
  </code></pre>
  
  <p>I'm guessing I need to pass it as an argument somewhere?</p>