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

230
Views
Javascript if variable value equal to variable value

I have code like this in my website

var created = 10;
var limitacc = 25;
var element = document.querySelector(".progress-bar");

if (created.value === limitacc.value){
element.classList.add("bg-danger");
} else {
element.classList.add("bg-warning");
}

I want to change the bootstrap progress bar bg if created is same value in limitacc but the code is not working its stay in bg-warning even the created to 25

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just remove .value

var created = 10;
var limitacc = 25;
var element = document.querySelector(".progress-bar");

if (created=== limitacc){
element.classList.add("bg-danger");
} else {
element.classList.add("bg-warning");
}
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!