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

248
Views
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
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!