title: Button onclick event doesn't fire in javascript
body: <p>I don't know what is the problem in this code.</p>
  
  <p>There are two input fields which are used for two variables to add, subtract, multiply and divide and 4 buttons (one each for add, subtract, multiply, and divide), but when I click on them nothing happens.</p>
  
  <pre><code>&lt;h1&gt;Calculator&lt;/h1&gt;
  &lt;input id="f1" /&gt;
  &lt;input id="f2" /&gt;
  &lt;button id="add"&gt;Add&lt;/button&gt;
  &lt;button id="sub"&gt;Sub&lt;/button&gt;
  &lt;button id="multi"&gt;Multi&lt;/button&gt;
  &lt;button id="div"&gt;Div&lt;/button&gt;
  </code></pre>
  
  
  
  <pre><code>var f1, f2, result;
  document.getElementById("add").onclick=function{
      f1= document.getElementById("f1").value;
      f2= document.getElementById("f2").value;
      result = return f1+f2;
  }
  document.getElementById("sub").onclick=function{
      f1= document.getElementById("f1").value;
      f2= document.getElementById("f2").value;
      result = return f1-f2;
  }
  document.getElementById("multi").onclick=function{
      f1= document.getElementById("f1").value;
      f2= document.getElementById("f2").value;
      result = return f1*f2;
  }
  document.getElementById("div").onclick=function{
      f1= document.getElementById("f1").value;
      f2= document.getElementById("f2").value;
      result = return f1/f2;
  }
  if(result!=null)
  alert("Result = "+result);
  </code></pre>