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');