How to allow numbers, backspace, delete, left and right arrow keys in the html text?

前端 未结 5 2105
野趣味
野趣味 2021-02-05 06:25

I am using following javascript code which I think should only allow numbers, backspace, delet, left arrow and right arrow keys in textbox, but it is also allowing alphabets. I

5条回答
  •  花落未央
    2021-02-05 07:05

    No doubt your code is correct but you missed "return" keyword in textbox.

    
    

    You can see the code here

提交回复
热议问题