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