JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr class="bucketRow"> <td> <input type="text" name="bucket_to[0]" value=""></td> <td class="bucketValueTD"><= <input type="text" name="bucket_from[0][]" value=""> <input type="button" class="bucket_add_row" value="add value"> </td> </tr>
</table>
JavaScript
$(".bucket_add_row").click(function() {
var newKeyValueRow = $("tr");
alert(newKeyValueRow.find('input[name*="from"]').length);
alert(newKeyValueRow.find('input[name~="from"]').length);
alert(newKeyValueRow.find('input[name|="bucket_from"]').length);
alert(newKeyValueRow.find('input[name]').eq(1).attr("name"));
});