title: How do I get the value of user inputted data?
body: <p>Say I have a website with some fields that I want to run some calculations on. I have a quantity input, and in my backbone.js View I bound the "change" event to this input.</p>
  
  <p>How do I get the value of the changes to the input field?</p>
  
  <p>I found this method (below) to get the value, but it feels wrong since I have to know the element ID again in my function. I couldn't do this with a class, for example. </p>
  
  <pre class="lang-js prettyprint-override"><code>window.Calculations = Backbone.View.extend({
  
      (...)
  
      events: {
          'change input#quantity': 'changeQuantity'
      },
  
  
      changeQuantity: function() {
          var val = $(this.el).find('input#quantity').val();
          this.model.set({'quantity': val});
      }
  
  });
  </code></pre>
  
  <p>And in the HTML:</p>
  
  <pre class="lang-js prettyprint-override"><code>&lt;input type="text" id="quantity" value="&lt;%= quantity %&gt;"&gt;
  </code></pre>
  
  <p>Am I approaching this correctly? Is there a variable that access the object that was changed? I know that $(this.el) isn't it, it's just the container.</p>