Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

293
Views
¿Es posible alternar classList del formulario que también tiene addeventlistener activado?

Realmente no tengo un fragmento de código, solo lo pensé e intenté esto, pero no funcionó

 const checkUserEmail = function (e) { const regex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$/; e.preventDefault(); if (!regex.test(inputEmail.value)) { this.classList.toggle(".error"); } else { return (inputEmail.value = ""); } }; form.addEventListener("submit", checkUserEmail, false);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Eliminar punto . en el nombre de la clase:

 form.classList.toggle("error")

Esto debería funcionar bien.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!