title: saving value of textbox on keypress event
body: <p>Good morning to everyone. Thanks for visiting my question.
  How can I save value of textbox on enter key and, when user presses up key, so that when user press the up arrow key, it loads the value of the last content in the textbox.</p>
  
  <p>it here my code so far, but it doesnt work unfortunately..</p>
  
  <pre><code> $(document).ready(function () {
  
      var lstMsg;
      $('#myTextbox').bind("keyup", function(e){
           if ( e.keyCode == 39){
                $(this).val($(lstMsg).val());
           }
           if ( e.keyCode == 13){
                lstMsg.val($(this).val());
           }
      });
   });
  </code></pre>
  
  <p>Thank you for your patience.</p>