JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<input name="/test/test1" type="text" />
<input name="/test/test2" type="text" />
<input name="/test/test3" type="text" />
</form>
JavaScript
var nameVal = '/test/test2';
$("input[name=" + nameVal + "]").val('testing');