> Hi im REALLY very new to html and javascript but I got stuck on a
question
> that bothers me a lot.
>
> <script language="javascript">
>
> var firstNumber = prompt("enter the first number", "");
> var secondNumber = prompt("enter the second number", "");
> var theTotal = firstNumber + secondNumber;
>
> document.write(firstNumber + " added to " + secondNumber + " equals "
+
> theTotal);
>
> </script>
>
> I relize what the problem is ( the + in theTotal var) but i dont know
what
> to do to make it work.
> Any help to a newbie is appreciated =).
>
Ok, this is all you have to do:
var firstNumber = parseInt(prompt("enter the first number", ""));
var secondNumber = parseInt(prompt("enter the second number", ""));
or substitute parseInt for parseFloat, for a floating point number.