mercredi 31 mars 2021

Any idea why this "if else" isn't working properly? [closed]

 if (selectedSize = 60) {
    document.getElementById("outputCost").innerHTML = x;
  } else if (selectedSize = "select") {
      document.getElementById("outputCost").innerHTML = " Please choose a size!";
  }
    
  if (selectedSize = 50) {
      document.getElementById("outputCost").innerHTML = y;
  } else if (selectedSize = "select") {
      document.getElementById("outputCost").innerHTML = " Please choose a size!";
  }

When I run it, it ALWAYS goes down to the second if statement and says that it's true. No matter what I do... thoughts?

Aucun commentaire:

Enregistrer un commentaire