Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

468
Vistas
How to check if an element has been unselected using JS?

I'm trying to check if an element has been unselected in a form; So I can check if the input is valid, but i'm stuck at the selected part; I've tried to add onclick() functions but as the div containing my form is selected too when I click on an input field, it's not working. Any ideas ?

this is what I have for a form click :

document.getElementById("contactForm").onclick = function ()
{
  if (messageClicked==1){
    console.log(document.getElementById("formMessage").value);
  }
  
}

and for an input :

document.getElementById("formMessage").onclick = function ()
{
  messageClicked=1;
}
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The answer is indeed the blur event ! Thanks user19642323 !

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda