Check out example codes for "html input number". It will help you in understanding the concepts better.

Code Example 1

<label for="quantity">Quantity (between 1 and 5):</label>
<input type="number" 
  id="quantity" name="quantity" min="1" max="5">

Code Example 2

<input type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" />

Code Example 3

<input type = number id = yourid min = 1 max = 100>

Code Example 4

<input type="number" id="quantity" name="quantity" min="1" max="5">

Learn ReactJs, React Native from akashmittal.com