Instantly share code, notes, and snippets.

Embed
What would you like to do?
Função mascara CEP colocar em <input type="text" onkeypress='mascaraCEP(this,"id_prox_campo");'>
function mascaraCEP(obj,prox) {
switch (obj.value.length) {
case 6:
obj.value = obj.value + "-";
break;
case 9:
document.getElementById(prox).focus();
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment