Java script calculator
<p>I am trying to make a simple calculator wher a person would in put two values and then when clicking a button an alert box would give the result. But it is not working.</p>

<pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;

&lt;!--//onclick handler //--&gt;
function gonum()
{
var input1=document.getElementById('a').value;
var operator=document.getElementById('op').value;
var input2=document.getElementById('b').value;


    if (operator=="+")
    {
        add(input1,input2);
    }
}


function add(input1,input2)
{
    alert(input1+input2);
}


&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form&gt;
&lt;input type="text" name="a"/&gt;
&lt;input type="text" name="op"/&gt;
&lt;input type="text" name="b"/&gt;
&lt;input type="button" value="=" name="btn" onClick="gonum()" /&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
