Skip to content

Instantly share code, notes, and snippets.

@briancollins
Last active December 15, 2015 03:39
Show Gist options
  • Save briancollins/5196193 to your computer and use it in GitHub Desktop.
Save briancollins/5196193 to your computer and use it in GitHub Desktop.
var currentType = 'unknown';
$('.card-number').keyup(function() {
$('.card-number, .card-number:parent').removeClass(currentType);
currentType = $.payment.cardType($('.card-number').val());
$('.card-number, .card-number:parent').addClass(currentType);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment