JSFiddle - React, Tailwind, and code Playground

HTML

<input id="text" type="text" value="Set my value!" />
<input id="submit" type="submit" value="Set the value" />

JavaScript

$('input#submit').click(function(){
   // The value would usually come from AJAX or some other unknown place
   $('input#text').val(null); 
});