 <p>You've set the variable i in the line <code>var i = document.getElementById('i').innerHTML = (document.getElementById("nine").value);</code>. <code>i</code> refers to the variable i, not to the control with id i.</p> <p>You'll have to do</p> <pre><code>var a = document.getElementById('number').value </code></pre> <p>etc.</p> <p>Edit: Ah I see you've declared a..h inside your methods. Remember that <code>var a</code> only applies within the curly brackets that it's declared inside, so declare them at the start of your script by doing <code>var a=0</code> etc. This is called the 'scope' of your variables.</p>