mardi 7 août 2018

My "prompt" won't load on the web page after i added the if statements

So i tested the prompt alone and it worked fine but after i added the text afterwards nothing seems to be loading. Please help.

var myage = parseInt(prompt("enter age ", 30), 10);

if (myage >= 0 && myage <= 10) {
  document.write("myage is between o and 10 <br/>");
}

if (!(myage >= 0 && myage <= 10)) {
  document.write(" myage is not between 0 and 10 <br/>");
}

if (myage >= 80 || myage <= 10) {
  document.write("myage is equal to or above 80 or 10 or less");
}

if ((myage >= 30 && myage <= 39) || (myage >= 80 && <= 89)) {
  document.write("myage is between 30 and 39 or myage is " + "between 80 and 89");

}

Aucun commentaire:

Enregistrer un commentaire