DEV Community

Krixnaas
Krixnaas

Posted on

How to block +,-,e in input type Number?

<input  
    type="number"
    min="1" 
    step="1"
    onkeypress="return event.keyCode === 8 
|| event.charCode >= 48 && event.charCode <= 57">
Enter fullscreen mode Exit fullscreen mode

Top comments (0)