JSFiddle - React, Tailwind, and code Playground

HTML

<html>
  <body>
    <form name="form" action="" method="POST">
      <div align="center">
    <br>
    <input class="1" type="text" name="a" size="25" value="1"><br>
    <input class="2" type="text" name="b" size="25" value="2"><br>
    <input class="3" type="text" name="c" size="25" value="3"><br>

    <input type="submit" value="Submit">
    <button class="reset" type="button" >Cancel</button><br>
      </div>
    </form>
  </body>
</html>

JavaScript

$('button.reset').click (function() {
    
   $('input.2').val('4');
    
});