JSFiddle - React, Tailwind, and code Playground
HTML
<div id="number">
<table id='mytable'>
</table>
</div>
CSS
div{
border: 1px solid green;
padding: 10px;
}
JavaScript
var str;
for(var i = 0; i < 4; i++){
str = '<td><input id="product'+i+'" type="checkbox" checked name="product' + i + '" value="Yes" />new product?';
str = str+'<td><input type="text"class="form-control" id="number ' + i + '" name="number' + i + '" placeholder="GTIN" data-checkbox-id="product'+i+'"></td>'
$("#mytable").append(str);
}
$("[id*='product']").on("click", function(){
var this_id = $(this).attr("id");
if( $(this).is(":checked") )
$("input[data-checkbox-id='"+this_id+"']").removeAttr("disabled");
else
$("input[data-checkbox-id='"+this_id+"']").attr("disabled", "disabled");
});