title: JavaScript: How to get value of sender input element from keyup event?
body: <p>I need to capture the keyup event to provide live validation when user is typing in an input (change event fires only when the input loses focus).</p>
  
  <p>I am having trouble getting the edited value of the input that fired the evnt.</p>
  
  <p>The code also runs on timer to prevent multiple calls when user is typing (fires only every 500 ms).</p>
  
  <p>I have several inputs with class "priceinput" and attach to keyup event of each like the following:</p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
      var timer;
      $(document).ready(function() 
      {
          $(".priceinput").each(function() 
          {
              $(this).keyup(function(e) 
              { 
                  clearTimeout(timer);
                  timer = setTimeout(function() 
                  {     
                  //how to get the value of the input element that was changed?  
                  var value = ???;
                      $.getJSON('/Validator/IsValidInput', { input: value },
                      function(response) 
                      {
                        //indicate if input is correct
                      });
                  }, 500);
              });
          });
       });
  &lt;/script&gt;
  </code></pre>
  
  <p>To get the sender input value, I have tried <code>$(this).val</code>, <code>this.val()</code>, <code>e.target.val()</code> but none seem to work.</p>
  
  <p>How do I get the value of the sender input?</p>