How do I prevent backspace when the dropdown is open in chrome? The solution by @J.Money works in IE but not in chrome when dropdown list is open. using Chrome Version 43.0.2357.134 Found solution for backspace at Prevent BACKSPACE from navigating back with jQuery (Like Google's Homepage) but still does not work when dropdown is open
Asked
Active
Viewed 176 times
0
-
Have you try `event.keyCode`? see [this](https://api.jqueryui.com/jQuery.ui.keyCode/) link for more imforamtion. – Nikunj Chotaliya Jul 30 '15 at 13:01
-
yes I am using event.keycode for backspace its 8. $(document).on("keydown", function (e) { //console.log(e.srcElement.type); if (e.which === 8 && !$(e.target).is("input:not([readonly]):not([type=radio]):not([type=checkbox]), textarea, [contentEditable], [contentEditable=true]")) { e.preventDefault(); } }); – Anand Jul 30 '15 at 13:53