How can I prevent Backspace from navigating back in javascript?

后端 未结 4 1321
天涯浪人
天涯浪人 2021-02-02 17:00

This works in IE, but I cannot get it to work in Opera or Firefox. I want to prevent Backspace from navigating away if and only if the current focus is the SELECT dropdown.

4条回答
  •  心在旅途
    2021-02-02 17:37

    That's trickier than I would have thought. Depending on the reason you are preventing the user from backspacing away from the page, something like this might work for you:

    
    

提交回复
热议问题