How do you detect Credit card type based on card number

| Last Updated: | In: Freebies, Javascript & Ajax


Hi Friend, I got some tutorial request from my regular blog readers. The question is “How do you detect Credit card type based on card number?”. I have done some R&D and finally got the Javascript code which detects the credit card type based on the credit card number.

Below is the simple and easy JavaScript code to detect credit card type when you type any credit card. Copy the below and use it in your web application.

How do you detect Credit card type based on card number

You can use it with PHP, ASP.net, and Java web technologies. copy paste below code in your page before head tag close.

For the display the ooutput use below html code.

Then output will be:


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like:


, , ,