Q:

Why am I getting no output from JavaScript with this code?

Can anyone see if there is an obvious problem with my code below. It's a very straight forward HTML page with JavaScript to add two inputted numbers or o multiply them. At the moment I'm getting no output. Thanks  
<html>
<head>
</head>
<body>
<form id="myform" name="myform">
Please enter your Numbers:<br/>
   Number 1: <input type=text id="number1" name="num1"/><br/>
   Number 2:<input type=text id="number2" name="num2"/><br/><br/>
   <input type=button name="add" id="add" value="Add" onclick="addNumbers()"/>
   <input type=button name="add" id="multiply" value="Multiply" onclick="multNumbers()"/><br/>

   <table name="mytable" id="t">
   </table>
   </form>

    <script type="text/javascript">
    var num1=document.getElementById('number1').value;
    var num2=document.getElementById('number2').value;
    var result="";

    addNumbers(){
    result=num1+num2;
    document.getElementById('t').innerHTML=result;
    }

    multNumbers(){
    result=num1*num2;
    document.getElementById('t').innerHTML=result;
    }

    </script>
</body>
</html>

A:

Your function declarations are missing the function keyword.
And in your functions you need to retrieve the input values when they are called.
function addNumbers() {
  var num1 = document.getElementById('number1').value;
  var num2 = document.getElementById('number2').value;

  var result = num1 + num2;

  // since your target is a table:
  var table = document.getElementById('t');
  // you need to create a row
  var row = table.insertRow(-1);
  // and in the row a cell
  var td = row.insertCell(-1);
  td.textContent = result;
}

EDIT
 var num1 = parseInt(document.getElementById('number1').value, 10);
 var num2 = parseInt(document.getElementById('number2').value, 10);

Or for decimals:
 var num1 = parseFloat(document.getElementById('number1').value);
 var num2 = parseFloat(document.getElementById('number2').value);

A:

You need to create the function as Oriol said, and also you need to make the input value integer like
var num1= +(document.getElementById('number1').value);

Or
var num1= parseInt(document.getElementById('number1').value, 10);

DEMO

