How to Correctly Detect Credit Card Type
Why does it even matter if you show the credit card type when the user is typing it in?  If the first 6 numbers determine the card type, then handling card type can be done on the backend.  Why make the effort to show users information that they already know, ie. card type?