Buy now!

NinjaMask

Sample 01. The Basic

HTML

                        

JS

                        $("#sample-date-01").ninjaMask('9999-99-99', {placeholder:'9999-99-99'});
                        $("#sample-date-02").ninjaMask('99/99/9999', { placeholder: '99/99/9999' });
                        $("#sample-date-03").ninjaMask('99/99/99', { placeholder: '99/99/99' });
                        $("#sample-date-04").ninjaMask('99/9999', { placeholder: '99/9999' });
                        
                        $("#sample-phone-01").ninjaMask('(999) 999-9999', { placeholder: '(999) 999-9999' });
                        $("#sample-phone-02").ninjaMask('(999) 999-9999? x99999', { placeholder: '(999) 999-9999? x99999' });
                        $("#sample-phone-03").ninjaMask('(99) 9999-9999?9', {
                            onBlur: function () {
                                if (this.element.value.length == 14)
                                    this.fnApplyNewMaskFormat('(99) 9999-9999?9');
                                else
                                    this.fnApplyNewMaskFormat('(99) 99999-999?9');
                            }
                        });

                        $("#sample-cpf").ninjaMask('999.999.999-99', { placeholder: '999.999.999-99' });
                        $("#sample-cnpj").ninjaMask('99.999.999/9999-99', { placeholder: '99.999.999/9999-99' });
                        $("#sample-cep").ninjaMask('99.999-999', { placeholder: '99.999-999' });

                        $("#sample-key").ninjaMask('aaa-99999-***', { placeholder: 'aaa-99999-***' });

                        $("#sample-serial").ninjaMask('****-*****-****-*****', { placeholder: '****-*****-****-*****' });