How to input only number in Textbox using javascript

In this tutorial you will learn how to limit a Text box only for taking digit input using javascript. You can simply do it through doing the input type number but this is not helpful in certain conditions.

See the tutorial below.

Html and Javascript code to limit text box to receive Number inputs only

We are done just copy this code in an Html file and run. It includes the text box which will only accept Numbers only.