1
I created a form but when I went to put mask in the CPF to look like this Ex.(000.000.000-00) does not assign
<head>
<meta charset="UTF-8">
<title></title>
<script src="JS/funcoes.js"></script>
<script src="JS/jquery-3.2.1.min.js"></script>
<script src="jQuery-Mask-Plugin-master/src/jquery.mask.js"></script>
<script src="JS/jquery-3.2.1.slim.min.js"></script>
</head>
if(event.keyCode !== 8){
if(texto.length === 3 || texto.length === 7){
document.getElementById("cpf").value == texto + ".";
} else if(texto.length === 11){
document.getElementById("cpf").value == texto + "-";
}
}
<form action="salvarregistro.php" method="POST">
<input type="text" name="cpf" size="40" id="cpf" required="" placeholder="CPF xxx.xxx.xxx-xx" onkeyup="mascCPF(this.value)"><br><br>
<button type="submit">Enviar dados</button>
</form>
Related: https://answall.com/q/199264/57801
– Don't Panic