title: Determine If Print/Cancel Button in Google Chrome's Print Preview is Clicked
body: <p>I've been printing my page using the code below:</p>
  
  <pre><code>window.print();
  </code></pre>
  
  <p>An image below is what the print preview in Google chrome browser looks like. It has two main buttons: <code>print</code> and <code>cancel</code>.</p>
  
  <p><img src="https://i.stack.imgur.com/BukhG.jpg" alt="enter image description here"></p>
  
  <p>I want to know if the user has clicked the <code>print</code> or <code>cancel</code> buttons. What I did uses jquery:</p>
  
  <p>HTML Code of the Print Preview:</p>
  
  <pre><code>&lt;button class="print default" i18n-content="printButton"&gt;Print&lt;/button&gt;
  &lt;button class="cancel" i18n-content="cancel"&gt;Cancel&lt;/button&gt;
  </code></pre>
  
  <p>Jquery Code:</p>
  
  <pre><code> $('button &gt; .cancel').click(function (e) {                
        alert('Cancel');
   });
  
   $('button &gt; .print').click(function (e) {                
        alert('Print');
   });
  </code></pre>
  
  <p>I tried the code above with no luck. What am I missing?</p>