Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

129
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda