how to insert keycode in switch statement in javascript code example
Example: how to insert keycode in switch statement in javascript
$(window).on('keydown', function (e) {
e.preventDefault();
if( e.KeyCode == 8 ) {
$('div').append('if
');
}
switch (e.keyCode) {
case 8: // Backspace
$('div').append('switch
');
break;
}
});