Hoe do you capture and pass data from an input field?

Hoe do you capture and pass data from an input field?

I tried the following two script but neither work. Please advise. Thank you.

 
  1. $("input[name='loanAmount']").mouseleave(function(){
  2. var Amount = $this.attr("input[name='loanAmount']").val();
  3. _satellite.setVar('loanAmount',Amount);
  4. _satellite.getVar('loanAmount');
  5. Return true;
 
  1. I also tried this.
  2.  
  3. var Amount = $this.attr("input[name='loanAmount']");
  4. _satellite.setVar('loanAmount',Amount);
  5. _satellite.getVar('loanAmount');
  6. Return true;