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

249
Vistas
Changing the color of a HTML element using JavaScript not working after conditional declared

I'm trying to change the color of a DIV Element that's assigned to the class about_title, with the condition of another div to have a display of "block", which id is about. This is my JS code:

   let about_title = document.getElementsByClassName("about_title") ;
   let about_content = document.getElementById("about") ;

   if (about_content.style.display == "block") {
       about_title.style.backgroundColor = "#ced2ff" ;
   } ;

It doesn't work and I can't get it done

about 4 years ago · Juan Pablo Isaza
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