Validate mail input using Jquery.MaskedInput and / or Jquery

-1

Hello, I need to validate an email input. I inserted JQuery in HTML and a plugin I found, Jquery.maskedInput. I was able to make masks for phone, cep, cpf, but for email I do not know how to proceed. Below is an input I made from CPF and it worked perfectly.

<html>
<script type="text/javascript" src="assets/jquery.js"></script><!--Necessário para as mascaras dos inputs-->
    <script type="text/javascript" src="assets/jquery.maskedinput.js"></script><!--Necessário para as mascaras dos inputs-->

<script type="text/javascript">
    $(document).ready(function(){
      $("#cpf").mask("999.999.999-99");
    });
  </script>

<p><input id="cpf"class="notNull" placeholder="CPF" oninput="this.className = ''" name="mil_cpf"></p>
</html>

I need to manipulate the input by its ID, since the class is already using it for something else. Thank you in advance for anyone who can help.

    
asked by anonymous 23.01.2018 / 00:08

1 answer

0

Try this out

$('#email').mask("A", {
    translation: {
        "A": { pattern: /[\w@\-.+]/, recursive: true }
    }
});

Source: link

    
23.01.2018 / 18:11