如何根据在另一个文本框中输入的值更新一个文本框中的值? [英] How to update the value in one text box based on the value entered in another text box?

查看:91
本文介绍了如何根据在另一个文本框中输入的值更新一个文本框中的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何根据在另一个文本框中输入/更改的值更新一个文本框中的值( txtInterest%)( txtAmt )?

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

推荐答案

使用jQuery的更改更新方法。使用你的例子:

Use jQuery's change method for updating. Using your example:

$('#txtAmt').change(function() {
  //get txtAmt value  
  var txtAmtval = $('#txtAmt').val();
  //change txtInterest% value
  $('#txtInterest%').val(txtAmtval);
});

这篇关于如何根据在另一个文本框中输入的值更新一个文本框中的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆