For input I tried doing this :
var x = prompt("Enter a Value","0");
var y = prompt("Enter a Value", "0");
Syntax : -
parseInt(string, radix); parseFloat(string,radix);
string : - it can be either a variable or a string itself .
radix :- (Optional) It is a numeric value between 2 - 36 , it represents the numeric system to be used.(Not for parseFloat() ) .
Try this : -
var x = prompt("Enter a Value","0"); var y = prompt("Enter a Value", "0"); var num1 = parseInt(x); var num2 = parseInt(y);
After this you can perform which ever calculations you want on them .