0

I am trying to make a Javascript function document.write on the click of a button. Here's my code:

    function answer {
    var answer = eval(Calc.Input.value);

    if (BUTTON IS PRESSED);
    document.write(answer)
    }

The code for the button that is pressed is:

  <INPUT TYPE="button" NAME="DoIt"  VALUE="  =  " OnClick="Calc.Input.value = eval(Calc.Input.value)">

So to sum up, on the click of that button, I need the answer of the value returned to become a variable, so that I can document.write it.

4

0 回答 0