The task is as follows: when entering text into input, it is necessary to prohibit certain characters from being entered from the keyboard. tried this:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>func key</title> </head> <body> <input type="text" id="inner"> <p id="outer"></p> </body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(function(){ var inner = document.getElementById('inner'); var outer = document.getElementById('outer'); inner.addEventListener("keydown",function(event){ // 79 - > ето буква 'O' if(event.charCode == 79) return false; console.log('hello'); console.log('char code = '+event.charCode); console.log('key code = '+event.keyCode); }) }); </script> </html> in this case, I want to prohibit entering the "o" button, returning false, but the event still occurs. Please tell me how I can implement this.