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

Code Example 1

<form 
    action="/action_page.php">

  <label for="username">Username:</label>
  <input type="text" 
    id="username" name="username" maxlength="10"><br><br>
  <input 
    type="submit" value="Submit">

    </form>

Learn ReactJs, React Native from akashmittal.com