0
How can I read the first character typed in the input and the part of the condition be called a specific mask.
if(Se o primeiro caractere no input for letra){
}else{
$('#login_username').mask('(99) 9999-9999?9').focusout(function() {
var phone, element;
element = $(this);
element.unmask();
phone = element.val().replace(/\D/g, '');
if( phone.substring(0, 1) === '0' ) {
element.mask("9999-999-9999");
} else if (phone.length > 10) {
element.mask("(99) 99999-999?9");
} else {
element.mask("(99) 9999-9999?9");
}
}).trigger('focusout');
}
Swap the image with the pf code @Igorsiqueira
– BrTkCa
Ready! Done!.
– Igor Siqueira