Good evening. I have this field with a mask when typing cpf, it happens that if you copy / paste it does not apply the mask, only the numbers.
How can I have the 2 mask forms in the imput?
function formatar(mascara, documento){
var i = documento.value.length;
var saida = mascara.substring(0,1);
var texto = mascara.substring(i)
if (texto.substring(0,1) != saida){
documento.value += texto.substring(0,1);
}
}
o input:
<input type="text" name="ao_cpf" id="ao_cpf" placeholder="CPF" maxlength="14" OnKeyPress="formatar('###.###.###-##', this)" />