I'm trying to validate the form field using jquery, if the size is greater than the number of cpf it puts the cnpj mask in that same field
var tamanho = $('.cpfcnpj').length;
if (tamanho == 11){
$(".cpfcnpj").mask('000.000.000-00',{reverse: true});
alert("teste");
}
else if(tamanho > 12){
$(".cpfcnpj").mask('00.000.000/0000-00',{reverse: true});
alert("dois");
}