错误绑定值jQuery

I'm trying to bind values to three different textboxes on corresponding testbox keydown event but it is just working for one textbox. I'm sharing my code please guide me with solution

HTML:

<table>
<tr>
    <td>
      <input type="text" id="BuyingPrice0" value="10" style="width:55px;" />
    </td>
    <td>
      <input type="text" id="bpusd0" readonly value="1.22" style="width:50px;" />
    </td>
</tr>
<tr>
    <td>
      <input type="text" id="BuyingPrice1" value="10" style="width:55px;" />
    </td>
    <td>
      <input type="text" id="bpusd1" readonly value="1.22" style="width:50px;" />
    </td>
</tr>
<tr>
    <td>
      <input type="text" id="BuyingPrice2" value="10" style="width:55px;" />
    </td>
    <td>
      <input type="text" id="bpusd2" readonly value="1.22" style="width:50px;" />
    </td>
</tr>
</table>

JQUERY:

var BindBP = function (id, BPUSD) {
    var errormsg = "";
    var amount = $(id).val();
    var country21 = $('#CurrencyValue').val();    
    $.ajax({
        type: "GET",
        url: cc,
        data: { amount: amount, country: country21 },
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            $(BPUSD).val(data);
        },
        error: function (jqXHR, exception) {
        }
    });
}

$(document).ready(function () {
    var count = 3;
    window.count = 0;
    var bp2 = $("#BuyingPrice" + window.count);
    var converted2 = $("#bpusd" + window.count);
    $(bp2).on("keydown", function () {        
        for (var i = count; i <= count - window.count; i++) {
            var bp = $("#BuyingPrice" + i);
            var converted = $("#bpusd" + i);
            BindBP(bp, converted);
        }
    });
});

i want to change value of bpusd checkboxes on corresponding buying price changed value but now it when i type in BuyingPrice of any id it is only getting BuyingPrice0 value. Please guide me the perfect way of doing this

Correct this line

var amount = $(id).val();

with this

var amount = $("'#" + id + "'").val();

Use as below:

 var errormsg = "";
 var amount = id.val();

because you are already used var bp = $("#BuyingPrice" + i); same as for country21

Try as

var BindBP = function (id, BPUSD) {
    var errormsg = "";
    var amount = $(id).val();
    var country21 = $('#CurrencyValue').val();    
    $.ajax({
        type: "GET",
        url: cc,
        data: { amount: amount, country: country21 },
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            successCallBack(BPUSD,data)
        },
        error: function (jqXHR, exception) {
        }
    });
}

function successCallBack(BPUSD,data)
{
    BPUSD.val(data);
}