jQuery addClass example

Change class name on click in jQuery

by Sergey Linnick

HTML

<input type="text" class="_numbe" id="cc_numbe">

JavaScript

(function(){(function(){var $,e=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};$=jQuery,$.fn.validateCreditCard=function(t,n){var a,r,i,l,o,s,c,u,g,d,p,f,h;for(l=[{name:"amex",pattern:/^3[47]/,valid_length:[15]},{name:"diners_club_carte_blanche",pattern:/^30[0-5]/,valid_length:[14]},{name:"diners_club_international",pattern:/^36/,valid_length:[14]},{name:"jcb",pattern:/^35(2[89]|[3-8][0-9])/,valid_length:[16]},{name:"laser",pattern:/^(6304|670[69]|6771)/,valid_length:[16,17,18,19]},{name:"visa_electron",pattern:/^(4026|417500|4508|4844|491(3|7))/,valid_length:[16]},{name:"visa",pattern:/^4/,valid_length:[16]},{name:"mastercard",pattern:/^5[1-5]/,valid_length:[16]},{name:"maestro",pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,valid_length:[12,13,14,15,16,17,18,19]},{name:"discover",pattern:/^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)/,valid_length:[16]}],a=!1,t&&("object"==typeof t?(n=t,a=!1,t=null):"function"==typeof t&&(a=!0)),null==n&&(n={}),null==n.accept&&(n.accept=function(){var e,t,n;for(n=[],e=0,t=l.length;t>e;e++)r=l[e],n.push(r.name);return n}()),h=n.accept,p=0,f=h.length;f>p;p++)if(i=h[p],e.call(function(){var e,t,n;for(n=[],e=0,t=l.length;t>e;e++)r=l[e],n.push(r.name);return n}(),i)<0)throw"Credit card type '"+i+"' is not supported";return o=function(t){var a,o,s;for(s=function(){var t,a,i,o;for(o=[],t=0,a=l.length;a>t;t++)r=l[t],i=r.name,e.call(n.accept,i)>=0&&o.push(r);return o}(),a=0,o=s.length;o>a;a++)if(i=s[a],t.match(i.pattern))return i;return null},c=function(e){var t,n,a,r,i,l;for(a=0,l=e.split("").reverse(),n=r=0,i=l.length;i>r;n=++r)t=l[n],t=+t,n%2?(t*=2,a+=10>t?t:t-9):a+=t;return a%10===0},s=function(t,n){var a;return a=t.length,e.call(n.valid_length,a)>=0},d=function(e){return function(e){var t,n;return i=o(e),n=!1,t=!1,null!=i&&(n=c(e),t=s(e,i)),{card_type:i,valid:n&&t,luhn_valid:n,length_valid:t}}}(this),g=function(e){return function(){var t;return...