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

119
Views
how to change the color of all href tab with an id associated with it inside a d3 function and work for other html pages where the id is available

I want to highlight rows that meet a condition as well as highlight an html tab with an id #htmlTab using d3

my code looks like this:

d3.rows.style('background-color', function(d){
if(row meets condition){
document.querySelector("#htmlTab").style.color = "orange";
return 'orange'}
 })

So at first d3 will highlight the rows if it meets the condition and then queryselector will color the #htmlTab. The problem I am having is that it is only changing the color of the the one tab that has the d3 table. I want it to color all the tabs that has an id #htmlTab on different pages as well. If this code is outside the d3.style function, it works for all the html tabs with that id: document.querySelector("#htmlTab").style.color = "orange";

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!