title: How to disable Esc button event on alert?
body: <p>I want to show an <code>alert</code> message on button click. After pressing OK of the alert popup I am going to do further processing. </p>
  
  <p>It's the expected flow, but when user presses the <kbd>Esc</kbd> button then also without clicking on OK my page goes to further processing. I want to restrict this flow i.e. restrict the <kbd>Esc</kbd> button event but I can't find any way to do this.</p>
  
  <pre><code>var keynum
  
  if (window.event) { // For IE
    keynum = e.keyCode
  } else if (e.which) { //For netscape Mozilla Firefox
    keynum = e.which
  }
  
  if (keynum == '113' &amp;&amp; saleFlag == true) {
    var totalQty = document.getElementById('totalQty').textContent;
    var totalAmt = document.getElementById('totalAmount').textContent;
  
    alert("You Played Total Qty: " + totalQty + " of Rs. " + totalAmt);    
  } else if (keynum === '27') {
    return false;
  }
  </code></pre>
  
  <p>but alert message is still closed .</p>
  
  <p>I want alert message as it is which is open on 113 keycode event. </p>