Credit Card Space
Formats input with a space after every 4 digits. Unlike other credit card number formatters it respects card numbers more then 16 digits.
You can set any split pattern with data-pattern
input attribute. '4 4 4 4' is default pattern.
Usage
As module
; const input = document;const ccSpace = input; const cardNumber = ccSpacevalue;
In browser
Add link into your page:
You've got global CreditCardSpace constructor:
var input = document;var ccInput = input;
Try it on test page