-1
I tried it this way:
function aviso() {
document.querySelector(".registers_button")
let email_box = document.querySelector(".email")
if (email_box.innerHTML == '') {
alert("Por favor, preencha os campos obrigatórios")
} else if (!email_box.innerHTML == '') {
alert("Redirecionando...")
}
}
<p class="email_text"> E-mail: <input class="email" type="text" placeholder="Ex: [email protected]"> </p>
Don’t let your
<input>
with<p>
use<label>
. Ex:<label class="email_text"> E-mail: <input class="email" type="text" placeholder="Ex: [email protected]"> </label>
. Also see <input type="email">– Augusto Vasques
Opa buddy, thank you very much, I will make this change in my code. Gradually I will learn HTML semantic.
– Caio Ribeiro