My title is pretty accurate to my problem but I think I may be barking up the wrong tree with the solutions I've been trying. I'm new to javascript and web development in general so forgive me for my lack of verbiage.
My program creates a new row of data when a part is selected from a drop-down menu. The rows populate with the data from an SQL table with information about the selected part such as: category, part_name, price etc. One of the td elements in the table is a drop-down to change the quantity that looks like this
<td>
<select data-id = <?php echo $row["part_id"];?> id = "qty_dropdown">
<option value = '1'> 1 </option>
<option value = '2'> 2 </option>
<option value = '3'> 3</option>
<option value = '4'> 4 </option>
<option value = '5'> 5 </option>
<option value = '6'> 6 </option>
<option value = '7'> 7 </option>
<option value = '8'> 8 </option>
<option value = '9'> 9 </option>
<option value ='10'> 10</option>
</td> </select>
If your selects are created inside a loop you might want to use name instead of id. Ids are meant to be unique. If you use the name property you can access them on the client side in javascript space by using
var selectLists = document.getElementsByName("qty_dropdown");
var firstSelectList = selectLists[0];