title: How can I get the value from an HTML input box into a CoffeeScript function?
body: <p>I am learning coffeescript, and I am wanting to make an script that multiplies the number I put in by PI. The issue is in how to get the HTML5 input to the coffeescript code (actually, in the HTML file it is now javascript).</p>
  
  <p>Coffeescript before compiling:</p>
  
  <pre><code>x = y * Math.PI;
  alert(x);
  </code></pre>
  
  <p>HTML5:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;&lt;title&gt;Coffeescript Test&lt;/title&gt;&lt;/head&gt;
      &lt;body&gt;
          &lt;form action="" method="GET"&gt;
      &lt;input type="text" name="input" value="NUMBER"&gt;
      &lt;input type="button" name="Solve" value="Equals" onClick="Coffee()"&gt;
      &lt;span id="result" /&gt;
          &lt;/form&gt;
  
          &lt;div id="Coffeescript"&gt;
              &lt;script type="text/javascript"&gt;
  (function Coffee() {
    var x;
    x = y * Math.PI;
    alert(x);
  }).call(this);
  &lt;/script&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The variable "y" is supposed to be the input. How do I get a number from the HTML input box to the new javascript code?
  If possible, give me coffeescript code instead of javascript.</p>
  
  <p>New code after using Paul D. Waite answer (This code works well):</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;&lt;title&gt;Coffeescript Test&lt;/title&gt;&lt;/head&gt;
      &lt;body&gt;
          &lt;div id="Coffeescript"&gt;
              &lt;script type="text/javascript"&gt;
  function coffee() {
    var x;
    x = document.querySelectorAll('input[name="pi_input"]')[0].value * Math.PI;
    alert(x);
  }
              &lt;/script&gt;
          &lt;/div&gt;
  &lt;form action="" method="GET"&gt;
      &lt;input type="text" name="pi_input" value="NUMBER"&gt;
      &lt;input type="button" name="Solve" value="Solve" onClick="coffee()"&gt;
      &lt;span id="result"/&gt;
  &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>