I have a textbox with input value of 20,466,000.00 . I want to return only the value of 20466000 without a comma and a decimal point. I tried the following :
// Get value
var nca_balance = $("#nca-balance").text();
var nca_amount = parseInt(nca_balance.replace(",", ""),10);
alert(nca_amount);
But it only returns the value of 20466 ? Why ? My expected result must be 20466000. Please help with my code. Thanks
<input>with.val(), not.text(); if that really were what your code looked like the.text()call would have returnedundefined.