如何使用以前的值生成文本框值的总和 [英] How to produce sum of a text box value with previous value
本文介绍了如何使用以前的值生成文本框值的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
var amount = $(#txtAmnt)。val();
$(#txtGrossAmnt)。val(金额);
当值为txtAmnt更改为另一个值我们如何生成新的txtGrossAmnt作为旧txtGrossAmnt值和新txtGrossAmnt值的总和
var amount = $("#txtAmnt").val();
$("#txtGrossAmnt").val(amount);
when value of txtAmnt changed to another value how can we produce new txtGrossAmnt as the sum of old txtGrossAmnt value and new txtGrossAmnt value
推荐答案
(#txtAmnt)。val();
("#txtAmnt").val();
(#txtGrossAmnt)。val(金额);
$ t $ b当txtAmnt的值更改为另一个值时,我们如何生成新的txtGrossAmnt as旧txtGrossAmnt值和新txtGrossAmnt值的总和
("#txtGrossAmnt").val(amount);
when value of txtAmnt changed to another value how can we produce new txtGrossAmnt as the sum of old txtGrossAmnt value and new txtGrossAmnt value
<div>
<input id="txtAmnt" type="text" />
<input id ="txtGrossAmnt" type="text" />
</div>
这篇关于如何使用以前的值生成文本框值的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文