Introduction:
In this post, find jQuery code to calculate difference in label/span values. To fetch the label/span value don't use .val() or .text() method, Instead use .html() method.
Example:
$(document).ready(function () {
var nCost = $('#spnCost').html();
var nSellingPrice = $('#spnSellingPrice').html();
var nProfit = parseFloat(nSellingPrice) - parseFloat(nCost);
$('#spnProfit').html(nProfit);
});
0 comments :
Post a Comment