Setting a variable with keyup()
<p>I am trying to grab a credit card number on on input field with the keyup() method, but I am getting undefined when I type the variable name in the console. Yet as I type in the field the digits are being logged to the console. </p>

<pre><code>$('#authorizenet_cc_number').keyup(function(){
        var ccNum =  $('#authorizenet_cc_number').val();
        console.log(ccNum);       
  });
</code></pre>

<p>Am I wrong in my understanding that when the value in the input changes it is stored in the ccNum variable?</p>
