I am using the below codes:
<script type="text/javascript">
function minus(){
var t=document.getElementById("totalcost").value;
var u=document.getElementById("advpay").value;
var set=(t-u);
document.getElementById("textfield").value=set;
return true;
}
</script>
I entered "6000" as value in totalcost id field and "1000" in advpay id field. so in textfield id field, it should show 5000 (6000-1000), but it is giving answer as NaN. where is the error ?