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

476
Views
how to ignore parent css opacity which is dynamic and forcefully applying on child span

Below I have a text which is a nested span. I just want to apply opacity to the first word Hello only. but, the opacity is changing to nested span also i.e STOP.

How to ignore the dynamic css changes of parent element?

let txt = document.getElementById("txt")

setInterval(() => {
    txt.style.opacity = txt.style.opacity == 1 ? 0.2 : 1
},500)
<span id="txt" style="font-size: 50px;">
  Hello
  <span style="opacity : 1">STOP</span>
</span>

about 4 years ago · Santiago Trujillo
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!