-1
Hello!
I want to perform a very simple function, which is to take the CPF of an input, remove the points and strokes and return the value in another input without the points and strokes.
The first part I managed to do, but I do not know how to return the function in the other input.
let botao = document.querySelector("#botao");
let retornaCpf = document.querySelector("#retornaCpf")
botao.onclick = function() {
let cpf_com_ponto_e_traco = document.querySelector("#cpf-com-ponto-e-traco").value;
let cpf_sem_ponto_e_traco = cpf_com_ponto_e_traco.replace(".", "").replace(".", "").replace("-", "");
alert(cpf_sem_ponto_e_traco);
}
<input type="text" id="cpf-com-ponto-e-traco">
<input type="text" id="retornaCpf">
<button id="botao">Pegar CPF</button>
Thank you very much.
– alexis moreira