Block E from being typed | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Block E from being typed

https://code.sololearn.com/We1rSdjApTeH/#html Ok, so right now, I have this set to simply say "Invalid input" if an E is present. But is there a way I can block E from being typed? Maybe remove E from the array so it wont be evaluated? UPDATE: Corrected the title Was: Block E from being typing? Corrected to: Block E from being typed? I can engrish I swear

30th Sep 2018, 3:16 AM
Daniel Cooper
Daniel Cooper - avatar
1 Answer
+ 3
Add: onkeydown="javascript: return event.keyCode == 69 ? false : true" to your <input> tag in the HTML
30th Sep 2018, 2:55 PM
Ronen Gil ืจื•ื ืŸ ื’ื™ืœ ุฑูˆู†ูŠู† ุฌูŠู„ ๐Ÿณ๏ธโ€๐ŸŒˆโ™พ๐Ÿ‡น๐Ÿ‡ฉ๐Ÿ‡ฎ๐Ÿ‡ฑ
Ronen Gil ืจื•ื ืŸ ื’ื™ืœ ุฑูˆู†ูŠู† ุฌูŠู„ ๐Ÿณ๏ธโ€๐ŸŒˆโ™พ๐Ÿ‡น๐Ÿ‡ฉ๐Ÿ‡ฎ๐Ÿ‡ฑ - avatar