get the TEXT BOX values : not working....?

get the TEXT BOX values : not working....?

How to get Text box value on key up using jQuery.
  1. $(document).ready(function(){
  2.       
  3. var val = $('input[name=leaddaystxt]').val();        -- this i s not working.

  4.             
  5.       $("input#leaddaystxt").live('keyup', function() {
  6.          alert text box value here.  
    alert(val);      -- this is not printing anything...
  7.      });
  8.   });
  9. HTML : <input type="text" name="leaddaystxt" id="leaddaystxt" value="" size="2" maxlength="2">