In HTML
I have it like this I don't know how to validate it since I don't want to do it for thetype="email"
<input class="input-100" type="email" name="email" placeholder="[email protected] " maxlength="39" id="email">
In HTML
I have it like this I don't know how to validate it since I don't want to do it for thetype="email"
<input class="input-100" type="email" name="email" placeholder="[email protected] " maxlength="39" id="email">
Based on what has been previously answered here (since you comment that it is not clear to you how you could do it), I will explain it to you in another way about how you could do it:
First
We create a function called
validarEmail()
, to which we will pass the HTML element as a parameter, which corresponds to the<input>
one where the Email will be written. In this function the text will be validated using a regular expression.Second
From the element
<input>
we will add the eventonkeyup()
, which will be executed every time a key is pressed .Third
We create a type element
<a>
which will have the word result as identifier , and from the functionvalidarEmail()
, we will change its text depending on the validation of the Email.Example