title: Mask input on html does not work
body: <p>I'm trying to create a mask to my input, but one strange error happens. I have to enter 11 numbers, and my mask have to make it like this: ###.###.###-##. But when I enter the sixth digit my current input become blank. I have no idea what is the problem.</p>
  
  <p>This is my script:</p>
  
  <pre><code>function mascararCpf(){
     var cpf = document.getElementById("idCpf");
  
     if((cpf.value.length == 3) || (cpf.value.length == 6)){ 
             cpf.value += ".";
         return;
     }
  
     if(cpf.value.length == 9){
         cpf.value += "-";
         return;
     }
   }
  </code></pre>
  
  <p>And this is my input:</p>
  
  <pre><code>&lt;label&gt; CPF: &lt;input type="number" autocomplete="on" name="cpf" id="idCpf"   placeholder="Seu CPF"  required onblur="validarCpf()" onkeypress="mascararCpf()"&gt;&lt;/label&gt;
  </code></pre>