Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1668 In Internet Explorer 4 if I press the backspace key, and no element has focus, it behaves as if the history back button was clicked, how do I trap this event and disable it?

You are here: irt.org | FAQ | JavaScript | Event | Q1668 [ previous next ]

Try:

<script language="JavaSCript"><!--
function mykeyhandler() {
   if (window.event && window.event.keyCode == 8) { // try to cancel the backspace
      window.event.cancelBubble = true;
      window.event.returnValue = false;
      return false;
   }
}

document.onkeydown = mykeyhandler;
//--></script>

Feedback on 'Q1668 In Internet Explorer 4 if I press the backspace key, and no element has focus, it behaves as if the history back button was clicked, how do I trap this event and disable it?'

©2018 Martin Webb