title: How to return value from jQuery function?
body: <p>I am trying to return value from jQuery function. Here is my function:</p>
  
  <pre><code> $('#output').keypress(function (event){ 
      var keycode = (event.keyCode ? event.keyCode : event.which);
      if(keycode == '13'){
          var read_lines = $('#output').val().split("\n");
  
          return  read_lines[read_lines.length-1];
  
      } 
      });
  </code></pre>
  
  <p>and I want to save the value it return in another variable </p>
  
  <pre><code>var newRead = functionName(event);
  alert (newRead);
  </code></pre>
  
  <p>How can I do this because I am not able to access function. Thanks in advance!</p>