How to force input to only allow Alpha Letters?

Short ONELINER:

<input onkeydown="return /[a-z]/i.test(event.key)" >

For all unicode letters try this regexp: /\p{L}/u (butthis) – and here is working example 🙂

Leave a Comment