jQuery Credit Card Input Mask Plugin - Credit.js

jQuery Credit Card Input Mask Plugin - Credit.js
File Size: 4.23 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Credit.js is a super simple jQuery plugin to create an input mask for credit card that only accepts 16 credit card numbers. Specially designed for E-commerce or business websites.

See also:

How to use it:

1. Include the required CSS into the head tag.

<link rel="stylesheet" type="text/css" href="credit.css" />

2. Include the jQuery library and the jQuery credit.js at the bottom of the page.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="credit.js"></script>

3. Create a standard text field in the page.

<input type="text" name="credit_card_number" class="credit" />

4. Call the plugin on the text field to turn it into an user-friendly credit card input.

<script type="text/javascript">
jQuery(function ( $ ){
$(".credit").credit();
});
</script>

This awesome jQuery plugin is developed by masasron. For more Advanced Usages, please check the demo page or visit the official website.