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.