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

264
Views
How do you implement an active state within a parent active state?

I am creating a vertical list of navigation topics (buttons) that will drop down when clicked on and reveal subtopics. When I click on the main topic, I want the color of the button to indicate the button is active, however, I also want an isActive indicator for the subtopics if they're clicked on as well. Here's an example of a similar design I would like. enter image description here

Long story short: I want the main topic to remain active while I'm clicking throughout the subtopics, but I want those subtopics to change color (indicate they're active) independently of the main topic. How can this be achieved? I am somewhat new to JS and these active states, so any help is appreciated!

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!