JSFiddle - React, Tailwind, and code Playground

HTML

<form name='form1' id='form1'>
<select name='column' id='column'>
    <option value='make'>make</option>
    <option value='color'>color</option>
</select>
<input type="text" id="copy" name="copy" />
<input type="button" id="fill" name="fill" value="Fill"/>
<table>
    <thead>
        <tr>
            <th>Make</th>
            <th>Color</th>
        </tr>
    </thead>
    <tr>
        <td><input type='text' name='make[]' id='make1'/></td>
        <td><input type='text' name='color[]' id='color1'/></td>
    </tr>
    <tr>
        <td><input type='text' name='make[]' id='make2'/></td>
        <td><input type='text' name='color[]' id='color2'/></td>            
    </tr>
</table>
</form>

JavaScript

$("#fill").click(function(){
       testScript(5);
});


function testScript(fill) {
    choice=document.form1.column.value+'[]';
    for($i=0;$i<fill;$i++){
        document.form1.elements[choice][$i].value=document.form1.copy.value;
    }
}