title: Basic javascript Fahrenheit/Celsius calculator
body: <p>I'm trying to do a Celsius/Fahrenheit conversion calculator, with a button for each conversion and the result being displayed in the appropriate textbox.  I must be missing something obvious here... I'm brand new to javascript and am just not getting it.  Here's what I have done so far:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt; 
          &lt;meta charset = "utf-8"/&gt;
          &lt;title&gt;Convert Fahrenheit and Celsius&lt;/title&gt;
          &lt;script type="text/javascript"&gt;
              &lt;!--
                  function convertToC() {
                      var fTempVal = parseFloat(document.getElementById('fTemp').value);
                  var cTempVal = (fTempVal - 32) * (5/9);
                  document.getElementById('cTemp').value = cTempVal;
              }
  
              function convertToF() {
                  var cTempVal = parseFloat(document.getElementById('cTemp').value);
                  var fTempVal = (cTempVal * (9/5)) + 32;
                  document.getElementById('fTemp').value = fTempVal;
              }
          // --&gt;
      &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;form name="conversionForm"&gt;
      &lt;table border="1"&gt;
      &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Fahrenheit&lt;/td&gt;
          &lt;td&gt;&lt;input name="fTemp" type="text"/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick="convertToC"&gt;Convert to Celsius&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Celsius&lt;/td&gt;
          &lt;td&gt;&lt;input name="cTemp" type="text"/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;button onclick="convertToF"&gt;Convert to Fahrenheit&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/form&gt;
      &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>