JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="new" name="new" value="1" />
<input type="button" value="Edit" />

JavaScript

$('input[type=button]').click(function(){
alert($('#new').val());// to get input text value
    $('#new').val('xxx');//to set input text value
});