title: Trouble getting a Javascript function to run
body: <p>I am still fairly new to Javascript and I am having some trouble getting a function to run properly. Here is what I have:</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;        
      function GravityCalc (ratio, name)
      {
          Weight = getElementById('WeightBox').value * ratio;
          document.getElementById('WeightText').innerHTML = 'You would weigh ' + weight + ' on ' + name;
      }
  &lt;/script&gt;
  
  Enter Weight: &lt;input type='text' id='WeightBox' name='Weight'&gt;&lt;br&gt;
  &lt;button onclick='GravityCalc(2.3,Jupiter)'&gt;calculate&lt;/button&gt;
  &lt;div id='WeightText'&gt; &lt;/div&gt;
  </code></pre>
  
  <p>The form displays perfectly, but nothing happens when the button is pressed. It also should probably be noted that eventually, the name and ratio parameters is going to be parsed in with PHP.</p>