JSFiddle - React, Tailwind, and code Playground
HTML
<input name="product[id]" type="text" value="22"/>
JavaScript
var pid =22;
$('input[name="product[id]"][value="' + pid + '"]').val('test');
<input name="product[id]" type="text" value="22"/>
var pid =22;
$('input[name="product[id]"][value="' + pid + '"]').val('test');