问题描述
< script type =text / javascript>
jQuery(''。CsDebt'')。live (''更改'',功能(事件){
event.preventDefault();
// alert(10);
/ /$(\".CsTotalDebit\").text(\"0.00);
var Total = $(this).closest(tr)。find(''。CsDebt'')。val ();
//警报(总计);
var m = 0;
$(。authors-list tr)。每个(函数(索引){
if(index!= 0){
var Totals = $(this).find(''。CsDebt'')。val ();
// alert(Totals);
//总计= parseFloat(总计);
// alert(Totals);
m = Number(m)+ Number(Totals);
alert(m);
$(。CsTotalDebit) .text(m);
//$(\".CsTotalDebit\").text(''hello'');
//$(## lbl_Debit)。text(m);
}
});
});
i希望将m值绑定到类名为CsTotalDebit的标签
当我尝试执行粗体显示命令显示 NaN
警告信息值正确显示..
之后显示问题..
请帮助我
提前谢谢。
<script type="text/javascript">
jQuery(''.CsDebt'').live(''change'', function(event) {
event.preventDefault();
//alert(10);
//$(".CsTotalDebit").text("0.00");
var Total = $(this).closest("tr").find(''.CsDebt'').val();
//alert(Total);
var m = 0;
$(".authors-list tr").each(function(index) {
if (index != 0) {
var Totals = $(this).find(''.CsDebt'').val();
//alert(Totals);
//Totals = parseFloat(Totals);
//alert(Totals);
m = Number(m) + Number(Totals);
alert(m);
$(".CsTotalDebit").text(m);
//$(".CsTotalDebit").text(''hello'');
//$("#lbl_Debit").text(m);
}
});
});
i want to bind the m value to a label whose class name is CsTotalDebit
when i am trying to execute the bold lined command it shows NaN
upto the alert message value is comming correctly..
after that it shows the problem..
pls help me
thanks in advance.
推荐答案
这篇关于使用JQuery对标签进行变量绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!