Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

120
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda