title: Default to original textarea val on Esc
body: <p>I'm trying to make an textarea default to the original value upon hitting esc. I can't seem to pass the origVal from the main code into the keypress if/else.</p>
  
  <p>Am I overthinking this or underthinking it?</p>
  
  <p>Fiddle:
  <a href="https://jsfiddle.net/kirkbross/brkbcr5c/1/" rel="nofollow">https://jsfiddle.net/kirkbross/brkbcr5c/1/</a></p>
  
  <pre><code>$(function() {
      var origVal = $("#textarea").val(); // set original value of textarea    
      $('#textarea').keydown(function(e, origVal) {
          var code = e.keyCode || e.which;
          if (code == 13) {
              e.preventDefault();
              //submit code
          } else if (code == 27) {
              $(this).blur();
              $(this).val(origVal); // default to original value on Esc
          }
      });
  });
  </code></pre>