RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: jsantell
Site: http://www.jsantell.com
$('#card_number').length is returning the size of the jQuery collection -- just selecting an ID, so yes, the length will be 1.
$('#card_number').length
$('#card_number').val() is the value currently which the input field is currently holding
$('#card_number').val()
$('#card_number').length
is returning the size of the jQuery collection -- just selecting an ID, so yes, the length will be 1.$('#card_number').val()
is the value currently which the input field is currently holding