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

247
Views
get real background color with opacity

console.log($("#box4").css("background-color")); // Solution does not fit
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="box1" style="background-color: blue; opacity: 0.5;">
  <div id="box2" style="background-color: yellow; opacity: 0.5;">
    <div id="box3" style="bacground-color: green; opacity: 0.5;">
      <div id="box4" style="font-size: 30px; padding: 20px; opacity: 0.9;">Aloha</div>
    </div>
  </div>
</div>

Need to get background-color value for id="box4" with JS oder JQ. The real value of the color that the user sees in the browser must be found. Not a CSS value.

You need to either calculate the color change with an opacity value, or some other solution.

If I use the "COLOR PICKER" google chrome plugin, I get the value #a0b0c0, rgb(160, 176, 192).

It is enough if the speech will only work in google chrome.

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!