I am开发者_如何学运维 getting the value but the problem is that the value gets wrapped in span tag.
For example 2 get the subtotl,
I used var subtotal=$inf_cartAmt(chkCartSubtlAmt);
Output for above syntax is
var subtotal=<span class="cartAmt_chkCartSubtlAmt">
$94.93
</span>;
Note how the val $94.93 is wrapped in span tag. Do we have any other syntax which can just give the value.
It's hard to tell what $inf_cartAmt
is from your code, but you could try -
$inf_cartAmt(chkCartSubtlAmt).text();
Failing that, you could use jQuery to remove the span tag from your string -
subtotal = $(subtotal).text()
精彩评论