I have a table row which looks like ![enter image description here](https://i.stack.imgur.com/BsagG.png)

the HTML looks like
![enter image description here](https://i.stack.imgur.com/cSLFU.png)

When the user changes the value of the Name field I pass the "select" to nameDropChanged function. After obtaining a reference to select I want to change the value of Number of Coupons select box. How can I obtain a reference to it using Jquery? Also there will be many such exact rows in the table.

Update : Here is the dummy HTML code and [jsfiddle link](http://jsfiddle.net/pyufe/1/)

```
    <table id="competitors_table" width="100%" style="border-bottom: #000000 solid 1px;">
<tbody>
    <tr>
        <td>Name:<select name="CompetitorIDs_Setting_[]" onchange="nameDropDownChanged(this);">
            <option value="0">N/A</option><optgroup label="Similar Stores"></optgroup>
            <optgroup label="Other Stores">
            <option value="1">flipkart</option>
            <option value="2">bigshoebazaar</option>
            <option value="160">presto</option>
            <option value="3">fabindia</option>
            <option value="4">fashnvia</option>
        </td>
        <td>
            <select name="Position_Setting_[]" onchange="dropDownChanged(this);">
                <option value="1000">Top</option>
                <option value="1001">Middle</option>
                <option value="1002">Bottom</option>                                                    
                <option value="">Enter Position</option>
            </select>
            <input type="text" name="PositionNumber_Setting_[]" size="3" style="display: none;">
        </td>
        <td>Number of Coupons:<select id="numberOfCoupons_Setting_[]"></select></td>
    </tr>
</tbody>
</table>

```

Javascript code

```
  function nameDropDownChanged(select)
{
    var selectedIndex = select.selectedIndex;   
    var WebsiteName = select.options[selectedIndex].innerHTML;
    var couponCount = <?php if(!empty($couponCount)){ echo json_encode($couponCount); }?>;

    if(Object.keys(couponCount).length > 0)
    {
        var numberOfCoupons = couponCount[WebsiteName];
        var numberOfCouponsDropDown = document.getElementById('numberOfCouponsSelect');
        $("#numberOfCouponsSelect").empty();
        if(numberOfCoupons > 0)
        {
            for(var i=1; i <= numberOfCoupons; i++)
            {
                var option = document.createElement('option');
                option.value = i;
                option.innerHTML = i;
                numberOfCouponsDropDown.appendChild(option);
            }
        }
        else
        {
            var option = document.createElement('option');
            option.value=1;
            option.innerHTML = "No Active Coupons";
            numberOfCouponsDropDown.appendChild(option);
        }
    }
}

```