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

365
Views
How can I change a hex color on a webpage with javascript?

I am writing a web extension (Chrome, Firefox) and I want to know what JavaScript will replace a style element's color with a different color. There is a style section that has

<style> --toolbar-bg-color: #0087FF; </style>

and I want to make that just a white background (#FFFFFF). Is there an easy JavaScript command that might do this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If the parent element has an id you could do something like this:

let element = document.getElementById('parentElement');
element.style['--toolbar-bg-color'] = '#FFFFFF';

Try it and let me know how it goes :)

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!