Home > OS >  Im trying to make this code wait untill the user prints 25 and then alert but instead it alwalys ale
Im trying to make this code wait untill the user prints 25 and then alert but instead it alwalys ale

Time:11-22

let x = (document.getElementById("SM").value);

if (x = 25){alert ("THIS IS just isnt working")}; console.log(document.getElementById("SM").value); console.log(x)enter code here

> <header><h1> Start

CodePudding user response:

This should work:

let x = document.getElementById("SM").value;
if (x == 25){
alert(x);
};

I think you said you want to alert the message. console.log only shows the message in developer tool, so usealert

  • Related