52
rated 0 times
[
57]
[
5]
/ answers: 1 / hits: 17695
/ 9 Years ago, fri, february 20, 2015, 12:00:00
How can I remove all text characters (not numbers or float) from a javascript variable ?
function deduct(){
var getamt= document.getElementById('cf').value; //eg: Amount is 1000
var value1 = 100;
var getamt2 = (value1-getamt);
document.getElementById('rf').value=getamt2;
}
I want getamt
as number. parseInt
is giving NaN
result.
More From » javascript