How to update the value in one text box based on the value entered in another text box?

后端 未结 3 1963
深忆病人
深忆病人 2020-12-19 00:36

How do I update the value in one text box (txtInterest%) based on the value entered/changed in another text box (txtAmt)?

3条回答
  •  醉梦人生
    2020-12-19 00:57

    This should work assuming txtAmt and txtInterest% are ids on your page:

    $(function() {
        $('#txtAmt').change(function() {
           $('#txtInterest%').val(this.value);
        });
    });
    

    See jQuery's change event handler.

提交回复
热议问题