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

127
Visualizações
how to change label Title css into Javascript

my css are

label[title="Hot"]{
  display:none;
}
label[title="Cold"]{
  display:none;
}

could you help me how can i change this into JavaScript

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

var hot_label = dcoument.querySelector('label[title="hot"]');
var cold_label = dcoument.querySelector('label[title="Cold"]');
//If you want to hide.
hot_label.style.display = "none";
cold_label.style.display = "none";
about 4 years ago · Juan Pablo Isaza Relatório

0

It sounds like you're asking how to do the same thing in JavaScript. If so, you would need to create a DOM element of type 'label' and set it's properties the same way you would if you were to use .getElementById or .querySelector. Should look something like:

var hot_label = document.createElement('label');
hot_label.title="Hot";
hot_label.display="none";

var cold_label = document.createElement('label');
cold_label.title="Hot";
cold_label.display="none";

Then you'd need to put them somewhere. Let's say for example your html has <div id="tempLabels"></div>. You would first get the container, then append the new DOM elements.

var container = document.getElementById('tempLabels');
container.appendChild(hot_label);
container.appendChild(cold_label);

Alternatively you could have one label and change the title:

var temp_label = document.createElement('label');

// when temp is hot
temp_label.title="Hot";
temp_label.display="inline-block"; //or whatever display type you're using

// when temp is cold
temp_label.title="Cold";
temp_label.display="inline-block"; //or whatever display type you're using

// hide label
temp_label.display="none";
about 4 years ago · Juan Pablo Isaza Relatório
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