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

128
Views
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 answers
Answer question

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 Report

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 Report
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!