Answers for "keypress event is working but when we press backspace to remove character condition is not working"

0

javascript detect backspace

var input = document.getElementById('myInput');
input.onkeydown = function() {
    var key = event.keyCode || event.charCode;
    if( key == 8 ){
    	//backspace pressed
    }
};
Posted by: Guest on January-17-2020

Code answers related to "keypress event is working but when we press backspace to remove character condition is not working"

Python Answers by Framework

Browse Popular Code Answers by Language